Roy Lichtenstein filter...

Just starting out? Need help? Post your questions and find answers here.
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Roy Lichtenstein filter...

Post by Michael Vogel »

I try to find out a useful approach for convert photos to pop art images automatically...

For all who don't know Roy Lichtstein's typical images, here's how they look like:
Image


And here's one approach how to modify photos to create a similar style, see steps 1 to 12 and step 21.

How could a Purebasic program create something like that automatically?
I think the code should be able to find areas with similar colors (skin tones) to reduce the colors to get a comic style image.
In a second iteration dark zones should be detected which should help to intensify borders and to create a dot rasterization overlay.

What do you think, would there be a better approach for doing that?
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Roy Lichtenstein filter...

Post by JHPJHP »

Hi Michael Vogel,

The following image was created using a couple examples from PureBasic Interface to OpenCV.
Nothing more was done besides opening and saving the image.

Original image was from the link you posted.
Image
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Roy Lichtenstein filter...

Post by IceSoft »

Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Roy Lichtenstein filter...

Post by Michael Vogel »

Thanks, these results don't look bad, but I am experimenting to go one step further now, the main problem is to find and simplify the contures.

It seems to be relatively easy to get results ignoring the contures by using a paint program, the image below was been done in a minute or so:
Example

But it takes me extremly long to smooth the contour lines and reduce them to a minimum before enhancing these lines to get the comic look.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Roy Lichtenstein filter...

Post by IdeasVacuum »

Hello Michael

Search the forum for a 2D OpenGL (or possibly OGRE) solution to finding edges automatically.
https://www.purebasic.fr/english/viewtopic.php?p=313643

If an image has a plain background it is a much easier task, make a grid of lines (vectors, not drawn, just programmatic) from image border to image border, then find the 1st pixel along each line that isn't the background colour - there you have a bunch of pixels describing the contour of the image subject.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Roy Lichtenstein filter...

Post by IdeasVacuum »

Hello Icesoft

It's a clever app, but the results could be better I think. A lot of work to convert from Python to PB too, especial since the process consists of half toning, edge detection and quantizing - and it's dependant on the Python PIL image format.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Roy Lichtenstein filter...

Post by JHPJHP »

Hi Michael Vogel,
Michael Vogel wrote:... the image below was been done in a minute or so
OpenCV can cut this time in half :lol:

If you're interested in using OpenCV, but no longer have a copy, send me a PM and I'll post you a link; I've always respected your contributions.
Michael Vogel wrote:But it takes me extremly long to smooth the contour lines and reduce them to a minimum before enhancing these lines to get the comic look.
Here are just a couple results (without modifying any parameters) from the numerous filter, edge detection, contour, etc. examples available.

Original image run three times through the smoothing example.
Image

Original image run once through the threshold example.
Image
Post Reply