Page 1 of 1

Action abstraction

Posted: 2010-10-06T20:25:49-07:00
by xpt
Hi,

I coined this term "action abstraction" for not knowing a better phrase to describe what I want to do.

I want to remove as much details as possible from images so as just to preserver the "main action". Take a look the following images then you may understand what I'm talking about:

http://imagebin.ca/view/JFiG6TZ.html
http://imagebin.ca/view/M6Z7FeQ.html

The ideal result would be, a BW cartoon image with no (gray) tones. Details are remove as much as possible as long as the major elements are there (I don't even care if nothing is left on their face).

I know there are many photo to sketch scripts out there, but nothing come close to the abstraction level that I want now. I know it's not an easy job, so I need your help.

I've prepared a set of 16 images for you to test/try on, some are easy and some are more difficult, but not in any special order. The above 2 being two of them. I've upload the set to:

http://www.zshare.net/download/811736231ff4e200/
http://www.megaupload.com/?d=5F0VYKE8
http://depositfiles.com/en/files/pqy1jcd76
http://www.badongo.com/file/24286807

Any one of above link will do (all have the same 1.01MB file 'action-abstract.rar'). Please note that I don't have any account there, so the file might be gone in several days. Please try to grab a copy as early as you can.

xpt

Re: Action abstraction

Posted: 2010-10-06T20:46:15-07:00
by fmw42
try


convert Action-Abstract-01.jpg -monochrome Action-Abstract-01_mono.gif

Re: Action abstraction

Posted: 2010-10-07T18:48:00-07:00
by xpt
fmw42 wrote:try


convert Action-Abstract-01.jpg -monochrome Action-Abstract-01_mono.gif
Actually, I was kinda expecting something even better than this,

http://www.imagemagick.org/Usage/photos/#color-in

well, maybe that's the best I can get so far.

thanks all the same.

Re: Action abstraction

Posted: 2010-10-07T18:57:11-07:00
by xpt
This is the best that I can get from Action-Abstract-01.jpg,

Image

Anyone can get it better?

Thanks

Re: Action abstraction

Posted: 2010-10-07T19:19:38-07:00
by xpt
If use

Code: Select all

convert Action-Abstract-01.jpg -colorspace gray -lat 20x20+3% output.gif
I'll get

Image

which size is bigger than the previous one (8345B vs. 7358B).

Re: Action abstraction

Posted: 2010-10-08T15:58:55-07:00
by fmw42
try adding -depth 2 -type bilevel

convert Action-Abstract-01.jpg -colorspace gray -lat 20x20+3% -depth 2 -type bilevel Action-Abstract-01_tmp1.gif

result is Filesize: 7.46KB

original jpg is Filesize: 29.1KB


or you can strip all the textual info

convert Action-Abstract-01.jpg -strip -colorspace gray -lat 20x20+3% -depth 2 -type bilevel Action-Abstract-01_tmp2.gif

result is Filesize: 6.44KB

Re: Action abstraction

Posted: 2010-10-09T15:44:22-07:00
by xpt
fmw42 wrote:try adding . . .

result is Filesize: 6.44KB
Thanks a lot, that's amazing.

Re: Action abstraction

Posted: 2010-10-11T08:39:10-07:00
by xpt
Ok, I found another way, here is the result:

Image

The command is:

Code: Select all

convert Action-Abstract-01.jpg -colorspace gray \( +clone -blur 0x2 \) +swap -compose divide -composite -linear-stretch 5%x0% photocopy.gif
However, I wasn't able to make it of BW color depth of 2, I tried

Code: Select all

convert Action-Abstract-01.jpg -colorspace gray \( +clone -blur 0x2 \) +swap -compose divide -composite -linear-stretch 5%x0% -monochrome -depth 2 -type bilevel  photocopy.png
convert Action-Abstract-01.jpg -colorspace gray \( +clone -blur 0x2 \) +swap -compose divide -composite -linear-stretch 5%x0% -depth 2 -type bilevel  photocopy.png
convert Action-Abstract-01.jpg -colorspace gray \( +clone -blur 0x2 \) +swap -compose divide -composite -linear-stretch 5%x0% -depth 2 photocopy.png
but all end up with distorted image. Please help.

Thanks

Re: Action abstraction

Posted: 2010-10-11T10:08:46-07:00
by fmw42
that is because you have a grayscale image and any method of binarizing it will not keep the grays as they were.

You can take your image and threshold it at some percent that looks good, then try

+dither -colors 2 -depth 2 -type bilevel result.gif

NOTE use GIF as it supports bilevel, but I am not sure PNG will do that.

Re: Action abstraction

Posted: 2010-10-11T13:47:59-07:00
by xpt
fmw42 wrote:+dither -colors 2 -depth 2 -type bilevel result.gif
Perfect! Thanks a lot!

PS. Here is how it looks now:

Image

Here is how it is converted:

Code: Select all

convert Action-Abstract-01.jpg -colorspace gray \( +clone -blur 0x3 \) +swap -compose divide -composite -linear-stretch 5%x0% +dither -colors 2 -depth 2 -type bilevel result3.gif
Thanks again.