Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64PE programming challenge? auto-convert image to photoreal etch-a-sketch drawing
#1
This morning I was searching online for a certain image done on an etch-a-sketch and couldn't find it. 
I even tried getting a bunch of ai engines to generate the image, and they all failed - miserably!

Then it struck me that this could be a neat programming challenge...

I think (in theory) that using QB64PE to draw a gray line on that silver-gray etch-a-sketch background, and have it look photoreal shouldn't be too hard. We could google etch-a-sketch and download a bunch of pictures and just zoom in real close to see what gradations of gray make up the individual lines. 

Then it becomes more of a problem of analyzing an image and vectorizing it, but only using movements that could be done with the two knobs (horizontal & vertical). 
We could allow diagonal lines to emulate turning both knobs at the same time - maybe one knob is turned faster than the other or if the person has a really steady hand, at the same rate. 

The actual analyzing of the image to turn into line art is something way beyond me, maybe the program could use QB64PE's HTTP capability to call some free REST API that does the raster to vector conversion? Or maybe this could be done in QB64PE, or just converted from existing logic done in some other language. Maybe Spriggsy or someone with a subscription to chatgpt or similar could try having it generate that logic? 

Anyway, I just thought it was an interesting idea that I'd share here with y'all!
Reply
#2
It sounds doable. Whether or not it is doable for me is a separate thing. I ain't no graphics guy. But it sounds like fun. I might give it a try.
The noticing will continue
Reply
#3
This is tempting I already have a program that makes line drawings from images, see Dav's coloring book.

   
b = b + ...
Reply
#4
(02-13-2025, 10:02 PM)bplus Wrote: This is tempting I already have a program that makes line drawings from images, see Dav's coloring book.
That's pretty cool... I'll have to check that out later!
Reply
#5
I just modified it to use _OpenFileDialog now I can do any image on the fly:
       

Sometimes not so good with the shades. Big Grin
b = b + ...
Reply
#6
bplus made an Etch-a-varmint. +1

Maybe Steve could cook one up using his paddle controllers. Of course he could play with his own knobs, too, but why bring gynecomastia into the discussion?

Pete Big Grin
Reply
#7
(02-13-2025, 10:47 PM)Pete Wrote: bplus made an Etch-a-varmint. +1

Maybe Steve could cook one up using his paddle controllers. Of course he could play with his own knobs, too, but why bring gynecomastia into the discussion?

Pete Big Grin
Here we go again!  Tongue

(02-13-2025, 10:33 PM)bplus Wrote: I just modified it to use _OpenFileDialog now I can do any image on the fly:


Sometimes not so good with the shades. Big Grin
Wow it looks like it kinda works... I ain't at a PC to try it. 
Say, will that work with QBJS where you upload an image or give it an image's Web URL?
Reply
#8
Should work in QBJS, just standard Point Analysis of colors. I don't know about using URL's and haven't practiced with using files in QBJS.

OH! I don't know if dbox has QBJS version of _OpenFileDialog().
b = b + ...
Reply
#9
Last night I searched the forum for my image outlining code. Turns out it must have been the last forum .org that Dav posted his coloring app and I showed code for outlining an image.

So I updated the code a tiny bit to select any png or jpg file to outline here:
https://qb64phoenix.com/forum/showthread...6#pid32066
reply #57 in Drawing Tools - Outlining an Image

In it I arrowed and commented a critcal variable to fiddle with to change the gray shading degree.
You can mess with that to increase or decrese outlines produced.
b = b + ...
Reply
#10
(02-14-2025, 02:42 PM)bplus Wrote: Last night I searched the forum for my image outlining code. Turns out it must have been the last forum .org that Dav posted his coloring app and I showed code for outlining an image.

So I updated the code a tiny bit to select any png or jpg file to outline here:
https://qb64phoenix.com/forum/showthread...6#pid32066
reply #57 in Drawing Tools - Outlining an Image

In it I arrowed and commented a critcal variable to fiddle with to change the gray shading degree.
You can mess with that to increase or decrese outlines produced.
Thanks for all this! Basement just got flooded, dealing with that, so may not run this immediately. I have it bookmarked & will check it out when the mess is cleaned up!
Reply




Users browsing this thread: 1 Guest(s)