Action abstraction
Action abstraction
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Action abstraction
try
convert Action-Abstract-01.jpg -monochrome Action-Abstract-01_mono.gif
convert Action-Abstract-01.jpg -monochrome Action-Abstract-01_mono.gif
Re: Action abstraction
Actually, I was kinda expecting something even better than this,fmw42 wrote:try
convert Action-Abstract-01.jpg -monochrome Action-Abstract-01_mono.gif
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
This is the best that I can get from Action-Abstract-01.jpg,

Anyone can get it better?
Thanks

Anyone can get it better?
Thanks
Re: Action abstraction
If use
I'll get

which size is bigger than the previous one (8345B vs. 7358B).
Code: Select all
convert Action-Abstract-01.jpg -colorspace gray -lat 20x20+3% output.gif

which size is bigger than the previous one (8345B vs. 7358B).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Action abstraction
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
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
Thanks a lot, that's amazing.fmw42 wrote:try adding . . .
result is Filesize: 6.44KB
Re: Action abstraction
Ok, I found another way, here is the result:

The command is:
However, I wasn't able to make it of BW color depth of 2, I tried
but all end up with distorted image. Please help.
Thanks

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
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
Thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Action abstraction
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.
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
Perfect! Thanks a lot!fmw42 wrote:+dither -colors 2 -depth 2 -type bilevel result.gif
PS. Here is how it looks now:

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