
Starry Night program to create image gcode
Description
This is mostly just show and tell of an experiment... So I have a buddy Tim McGough that suggested I should try to make the Starry Night Van Gogh image by outputting colored dots by swiping from left to right. This is different than my previous method of outputting STL files for each color. Instead, this would require custom gcode for the printer. I started by using only black and white (although more colors would work too) and making a program that would output gcode to make 1mm x 0.4 (nozzle width) of filament for each pixel doing that for 2 or 3 lines for each row. Well that was an ugly smeary mess and nothing was discernible other than I could tell it was switching colors only that it was so mixed that it was just mud. So basically, the diamond head needs more time to switch colors when mixing. Think of this as one mm line dot per one pixel. (see ugly pic on print bed) I then tried for each pixel, going up 0.4, then right 0.4, down 0.4, then right 0.4. So that's 1.6mm dot per pixel. That gives it some more time for some more filament to come out. With a few pixels on a row of similar color it should get closer to the color. It's still a smeary mess but at least now you can see that the starry night image is almost discernible and shades of blobs appear that correspond to the starry night image. (see image). So basically instead of one dot per pixel, it's doing 4 dots (2x2) per pixel. I had some inversion issues with x and y so I swapped those (I think) in software. I tried doing 3x3 or 9 dots per pixel. it goes up 0.8, right 0.8, down 0.4, left 0.4, down 0.4 and right 0.4. That's 3.2mm per pixel. This makes it bigger and it goes off the edges of my print bed so I cropped the image in software and gave it a try. This time the colors were much more vibrant. (see ribbon looking image) It would have probably worked with the 3x3 but my printer gave up the ghost. The heated bed wire came loose which caused some sort of current draw which blew out a mosfet, outputting smelly blue magic smoke, and melted a few things like the power input terminal. So basically I need to swap out the printer control ramps board. So I can't test further until I get that repaired. ugg. But at least this was a proof of concept and it actually worked to my satisfaction. I would probably go with a lower resolution image so that it can be smaller and then use the 3x3 or 9 pixel method so I can get decent colors. I need to write the program so that it's more user friendly so that it can be customized for your printer but maybe I'll get around to that some day after I can test it more. The program takes an image (mine was downsized to 160x104 with 12 b/w colors) and outputs a gcode file. The config input file isn't read in yet (haven't gotten to that yet). There's also an output color table which may help with editing the header to set the color table. The program uses the GD module so you'll probably have to do "cpan install gd" if you want to use it. USAGE: image2image.pl input_image_file config_file output_gcode output_color_table So mostly right now, this is just show-and-tell and probably the worst and most expensive way to print out a picture, but feel free to play with the program and of course USE AT YOUR OWN RISK!
Statistics
Likes
2
Downloads
0