photo effect - Warholize - line art

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: photo effect - Warholize - line art

Post by fmw42 »

If you want to use your method with a color image (rather than convert to grayscale), then try this

Image

convert \( birdofparadise.jpg -resize 50% \) \
\( -clone 0 -modulate 100%,100%,15% \) \
\( -clone 0 -modulate 100%,100%,55% \) \
\( -clone 0 -modulate 100%,100%,95% \) \
\( -clone 0 -modulate 100%,100%,145% \) \
-delete 0 miff:- | \
montage miff:- -tile 2x2 -geometry +5+5 -background white \
birdofparadise_warhol.jpg

Image


NOTE hue=95% is nearly 100% which is no change from the original input. So you might as well avoid the extra step for 95% and do


convert \( birdofparadise.jpg -resize 50% \) \
\( -clone 0 -modulate 100%,100%,0% \) \
\( -clone 0 -modulate 100%,100%,50% \) \
\( -clone 0 -modulate 100%,100%,150% \) \
-swap 0,1 -swap 1,2 miff:- | \
montage miff:- -tile 2x2 -geometry +5+5 -background white \
birdofparadise_warhol2.jpg


Image
Tagomago
Posts: 36
Joined: 2011-02-10T09:55:33-07:00
Authentication code: 8675308

Re: photo effect - Warholize - line art

Post by Tagomago »

Thanks, that looks quite good. Dithering to 3 colors worked nicely for me as well.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: photo effect - Warholize - line art

Post by fmw42 »

Here is reducing colors to 10


convert \( birdofparadise.jpg -resize 50% +dither -colors 10 \) \
\( -clone 0 -modulate 100%,100%,0% \) \
\( -clone 0 -modulate 100%,100%,50% \) \
\( -clone 0 -modulate 100%,100%,150% \) \
-swap 0,1 -swap 1,2 miff:- | \
montage miff:- -tile 2x2 -geometry +5+5 -background white \
birdofparadise_warhol3.jpg

Image


Here is reducing to 3 colors:


convert \( birdofparadise.jpg -resize 50% +dither -colors 3 \) \
\( -clone 0 -modulate 100%,100%,0% \) \
\( -clone 0 -modulate 100%,100%,50% \) \
\( -clone 0 -modulate 100%,100%,150% \) \
-swap 0,1 -swap 1,2 miff:- | \
montage miff:- -tile 2x2 -geometry +5+5 -background white \
birdofparadise_warhol4.jpg

Image
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: photo effect - Warholize - line art

Post by anthony »

The above shows one aspect of the current 'color reduction' or 'quantization' function that is currently built into IM. It tends to generate colors which are in the middle of each of the regions of the colors selected. However it does have an optimization that will have it select colors that are used a lot (for cartoon like images).

That is to say in a typical photo with heavy color reduction, you tend to get flat, midtone colors. rather than bright primary/secondary colors.

Eventually I would like to see IM have the ability to select from a number of different color reduction methods.

See http://www.imagemagick.org/Usage/quanti ... _not_exact
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: photo effect - Warholize - line art

Post by myspacee »

hello,
see that post grow day by day. So, any chance to have something working for windows user ?

Thank you all for support,

m.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: photo effect - Warholize - line art

Post by fmw42 »

The command lines above should easily translate into windows. Though you might have to make it into two command lines as I don't know if the pipe feature of Unix goes over to Windows. I am not a windows user. But just remove the \ before ( and ) and use ^ rather than \ for continuations to next line. And escape % with %%. See http://www.imagemagick.org/Usage/windows/ Perhaps, some kind windows user could translate this here for you.
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: photo effect - Warholize - line art

Post by myspacee »

Confirm easy conversion for lines above.

Code: Select all

convert ( test.jpg -resize 50%% +dither -colors 10 ) ( -clone 0 -modulate 100%%,100%%,0%% ) ( -clone 0 -modulate 100%%,100%%,50%% ) ( -clone 0 -modulate 100%%,100%%,150%% ) -swap 0,1 -swap 1,2 miff:- | montage miff:- -tile 2x2 -geometry +10+5 -background white birdofparadise_warhol3.jpg
maybe not so Warlhol as i hope, but thank you all, as usual.

m.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: photo effect - Warholize - line art

Post by anthony »

You may be able to make the colors more glaringly by increasing the saturation using the -modulate operation.
http://www.imagemagick.org/Usage/colors_mods/#modulate
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: photo effect - Warholize - line art

Post by fmw42 »

anthony wrote:You may be able to make the colors more glaringly by increasing the saturation using the -modulate operation.
http://www.imagemagick.org/Usage/colors_mods/#modulate

convert \( birdofparadise.jpg -resize 50% +dither -colors 3 \) \
\( -clone 0 -modulate 100%,200%,0% \) \
\( -clone 0 -modulate 100%,200%,50% \) \
\( -clone 0 -modulate 100%,200%,150% \) \
-swap 0,1 -swap 1,2 miff:- | \
montage miff:- -tile 2x2 -geometry +5+5 -background white \
birdofparadise_warhol5.jpg

Image
Post Reply