// Title: Happy Shifting - A 4-bit Combinational Circuit Shifter Party
// Draw the base of the shifter
ctx.fillStyle = '#f0f0f0';
ctx.fillRect(50, 50, 412, 300); // Large rectangle for the circuit body
// Color for the inputs and outputs
ctx.fillStyle = '#d3d3d3';
// Inputs
ctx.fillRect(60, 70, 30, 30); // Input I0
ctx.fillRect(60, 120, 30, 30); // Input I1
ctx.fillRect(60, 170, 30, 30); // Input I2
ctx.fillRect(60, 220, 30, 30); // Input I3
ctx.fillRect(60, 270, 30, 30); // Input S1
ctx.fillRect(60, 320, 30, 30); // Input S0
// Outputs
ctx.fillRect(422, 70, 30, 30); // Output O0
ctx.fillRect(422, 120, 30, 30); // Output O1
ctx.fillRect(422, 170, 30, 30); // Output O2
ctx.fillRect(422, 220, 30, 30); // Output O3
// Draw lines for connections
ctx.strokeStyle = '#000000';
ctx.lineWidth = 2;
// Input Lines
ctx.beginPath();
ctx.moveTo(75, 85);
ctx.lineTo(150, 85);
ctx.stroke(); // Connect I0 to the circuit
ctx.beginPath();
ctx.moveTo(75, 135);
ctx.lineTo(150, 135);
ctx.stroke(); // Connect I1 to the circuit
ctx.beginPath();
ctx.moveTo(75, 185);
ctx.lineTo(150, 185);
ctx.stroke(); // Connect I2 to the circuit
ctx.beginPath();
ctx.moveTo(75, 235);
ctx.lineTo(150, 235);
ctx.stroke(); // Connect I3 to the circuit
ctx.beginPath();
ctx.moveTo(75, 285);
ctx.lineTo(250, 285);
ctx.stroke(); // Connect S1 to the circuit (shared line for select inputs)
ctx.beginPath();
ctx.moveTo(75, 335);
ctx.lineTo(250, 335);
ctx.stroke(); // Connect S0 to the same line as S1
// Output Lines
ctx.beginPath();
ctx.moveTo(422, 85);
ctx.lineTo(362, 85);
ctx.stroke(); // Connect circuit to O0
ctx.beginPath();
ctx.moveTo(422, 135);
ctx.lineTo(362, 135);
ctx.stroke(); // Connect circuit to O1
ctx.beginPath();
ctx.moveTo(422, 185);
ctx.lineTo(362, 185);
ctx.stroke(); // Connect circuit to O2
ctx.beginPath();
ctx.moveTo(422, 235);
ctx.lineTo(362, 235);
ctx.stroke(); // Connect circuit to O3
// Draw the muxes and gates inside the shifter
ctx.fillStyle = '#90ee90'; // Light green for the logic elements
// Muxes for each bit
ctx.fillRect(200, 65, 50, 50); // MUX for O0
ctx.fillRect(200, 115, 50, 50); // MUX for O1
ctx.fillRect(200, 165, 50, 50); // MUX for O2
ctx.fillRect(200, 215, 50, 50); // MUX for O3
// Internal connections for the logic
ctx.strokeStyle = '#ff4500'; // A spicy orange for internal logic connections
ctx.lineWidth = 1;
// Connect select lines to each mux
ctx.beginPath();
ctx.moveTo(250, 310);
ctx.lineTo(225, 310);
ctx.lineTo(225, 90);
ctx.lineTo(250, 90);
ctx.stroke(); // S0 and S1 to MUX O0
ctx.beginPath();
ctx.moveTo(250, 310);
ctx.lineTo(225, 310);
ctx.lineTo(225, 140);
ctx.lineTo(250, 140);
ctx.stroke(); // S0 and S1 to MUX O1
ctx.beginPath();
ctx.moveTo(250, 310);
ctx.lineTo(225, 310);
ctx.lineTo(225, 190);
ctx.lineTo(250, 190);
ctx.stroke(); // S0 and S1 to MUX O2
ctx.beginPath();
ctx.moveTo(250, 310);
ctx.lineTo(225, 310);
ctx.lineTo(225, 240);
ctx.lineTo(250, 240);
ctx.stroke(); // S0 and S1 to MUX O3
// Connect input I0 to MUX for O1
ctx.beginPath();
ctx.moveTo(150, 85);
ctx.lineTo(200, 135);
ctx.stroke();
// Connect input I1 to MUX for O2
ctx.beginPath();
ctx.moveTo(150, 135);
ctx.lineTo(200, 185);
ctx.stroke();
// Connect input I2 to MUX for O3
ctx.beginPath();
ctx.moveTo(150, 185);
ctx.lineTo(200, 235);
ctx.stroke();
// Connect MUX outputs to circuit outputs
ctx.beginPath();
ctx.moveTo(250, 90);
ctx.lineTo(362, 90);
ctx.stroke(); // MUX O0 to O0
ctx.beginPath();
ctx.moveTo(250, 140);
ctx.lineTo(362, 140);
ctx.stroke(); // MUX O1 to O1
ctx.beginPath();
ctx.moveTo(250, 190);
ctx.lineTo(362, 190);
ctx.stroke(); // MUX O2 to O2
ctx.beginPath();
ctx.moveTo(250, 240);
ctx.lineTo(362, 240);
ctx.stroke(); // MUX O3 to O3
// Add some fun little LEDs for input and output indicators
const drawLED = (x, y, color) => {
ctx.beginPath();
ctx.arc(x, y, 5, 0, 2 * Math.PI);
ctx.fillStyle = color;
ctx.fill();
ctx.stroke();
};
// Input LEDs
// Output LEDs
// Important: Append the canvas to the DOM to see the result
// The LEDs aren't real, but they sure do make the circuit look like it's having a party! π
These are recent AI images made by the community! These may use any AI model including DALL-E 3, Flux, Stable Diffusion, GPT-4, o1, and more and may be anything from simple animated SVGs to PNGs.
DrawGPT is a an AI art generator that uses GPT-4, o1, o3, DALL-E 3, Gemini 2.0, Imagegen 3.0, Flux, Stable Diffusion, and Custom GPTs, ChatGPT, and other large language models to generate new images from text prompts.
This does not require access to premium AI model subscriptions, it is able to be used by anyone with an internet connection and tokens. This allows everyone to get access to the very best AI art generation technology.
Artificial intelligence may create strange or unusual images. It is being used to generated images for advertising, entertainment, gaming, marketing, and fun right now!
Because Draw GPT has access to do many models we assume the model providers have followed best practices when attributing or utilizing data and images in the training data.
Yes! You can use the images for commercial purposes! And so can Draw GPT.
DrawGPT can draw anything you can think of and more! Just type your text prompt in to the textbox exactly like ChatGPT and see what the AI gives you! Seriously, you can get GPT to draw just about anything for you that you can type in the box.
DrawGPT creates images in PNG, SVG, and Javascript format for download and use. This is different than other AI art projects that only create images in PNG format; being able to get a scene graph via Javascript draw commands is a unique feature of this project and getting any AI art in SVG vector format is unique to DrawGPT.
Many people use this to generate quick art for simple projects, video game assets, new business logos, and more. It is also used to generate images for advertising, entertainment, gaming, marketing, creating art for ads and blog posts with AI and fun.
Want to learn more about DrawGPT, the types of possible image renders, and how to use DrawGPT in your next project as a developer?
Check out our AI image generation API!
DrawGPT is runs on an AI that has never actually "seen" an image as embodied AI in its life!
This method of drawing images using raw code is not a great way to draw complex images with lots of structure. It may be able to make photograph quality artwork and professional illustrations with AI but it can fail when using certain types of typography.
Yes and no. Same same but different.
ChatGPT runs on the same model that this project uses, so this is like using ChatGPT to generate images, but it is a different instance of the model. This means that the AI is not precisly the same but it is the same quality AI, image generation AI, large language model, and overall AI art that ChatGPT is using and that Chat GPT can draw.
What is the difference? ChatGPT is specifically wired up to be conversational and track a conversation thread across multiple user prompts. Images in ChatGPT using DALL-E 3 are not saved to the Intenet and made available publicly.
In comparison DrawGPT does not remember things from prompt to prompt, each image is a unique image that does not reference any of the images or prompts previously supplied.
You can do what you want it's your party.
We humbly ask that you backlink to DrawGPT if you do use our images in any promotion or commercial ways, but it is not required.
At the moment all images & Javascript code generated by this tool under the CC0 License with outrageous added term that the license can be revoked or retroactively changed at any time without warning for any image.
Yes! You can use the images for commercial purposes! And so can DrawGPT.
Images & prompts may be made made public.
Depending on the situation the prompts themselves are stored internally for research purposes.
Employees at OpenAI and DrawGPT have access to any prompts you submit.
DO NOT SUBMIT PERSONAL INFORMATION.