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:
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?
Roy Lichtenstein filter...
- Michael Vogel
- Addict
- Posts: 2680
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Roy Lichtenstein filter...
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.
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.
Re: Roy Lichtenstein filter...
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
- Michael Vogel
- Addict
- Posts: 2680
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Roy Lichtenstein filter...
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.
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.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Roy Lichtenstein filter...
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.
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.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Roy Lichtenstein filter...
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.
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.
If it sounds simple, you have not grasped the complexity.
Re: Roy Lichtenstein filter...
Hi Michael Vogel,
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.
Original image run three times through the smoothing example.
Original image run once through the threshold example.
OpenCV can cut this time in halfMichael Vogel wrote:... the image below was been done in a minute or so
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.
Here are just a couple results (without modifying any parameters) from the numerous filter, edge detection, contour, etc. examples available.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.
Original image run three times through the smoothing example.
Original image run once through the threshold example.