It is currently Mon Jul 22, 2024 4:33 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Custom values posterization
PostPosted: Wed Nov 20, 2013 5:52 am  (#1) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Hi,

I am just working a an alternative posterization algorithm. The basic difference is that the channel values are not fixed, like: 0, 0.25, 0.5, 0.75, 1, but algorithm is allowed to pick own values based on values in image.

As by now it is a crude python script, slow of course, but easy to tinker with... Later on it could be reworked to gimp plugin.

I am not sure if such algorithm exists and is available in gimp, and whether there is an interest....

Below are couple of examples. Each one is split, right side is posterized, left one is original. Also see a text on the images to learn the level of posterization and also generated custom values...

I would welcome any feedback :)


Attachments:
File comment: posterize level 10 (=1000 colors)
post_img_6524-L10.jpg
post_img_6524-L10.jpg [ 311.93 KiB | Viewed 3660 times ]
File comment: posterize level 3 (=27 colors)
post_img_5380-L3.jpg
post_img_5380-L3.jpg [ 542.21 KiB | Viewed 3660 times ]
File comment: posterize level 2 (=8 colors)
post_img_6524-L2.jpg
post_img_6524-L2.jpg [ 293.71 KiB | Viewed 3660 times ]
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 7:38 am  (#2) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Well, I just added simple "dithering", that is passing remainders to the next pixel in line, so to show an effect I am attaching one of above images in dither mode. I just emphasize, it is posterization level 2 - 8 colors in total

EDIT: the intensity of dithering is controllable, so I am attaching two images to show it...


Attachments:
File comment: 8 colors in total, relatively strong dithering
post_img_6524-L2_D0.8.jpg
post_img_6524-L2_D0.8.jpg [ 427.15 KiB | Viewed 3601 times ]
File comment: 8 colors in total, weaker dithering
post_img_6524-L2_D0.2.jpg
post_img_6524-L2_D0.2.jpg [ 356.14 KiB | Viewed 3601 times ]
Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 8:46 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4757
tibor95 wrote:
I am not sure if such algorithm exists and is available in gimp, and whether there is an interest....


You can color-index an image using your own color map.

_________________
Image


Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 9:18 am  (#4) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
These are two different techniques...

Of course indexation with 8 colors provides better results then this my posterization of level 2 - that gives 8 colors as well, yet my posterization provides better results than "standard" posterization.

I am just testing an interest, if any....

=EDIT=

Just a note: I am working on it because I like the technical aspects of this technique, though I must say I have no use for it personally ;)


Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 10:07 am  (#5) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I found the posterize filter quite limited, also because it jumps from a too small number of colurs to a far to huge skipping all intermediate values.

And i found a couple of scripts ( one from Saulgoode ...i think the other from RobA) that to me are a better alternative

About your implementation ... i don't know i think will mainly depend on user interactivity ,from how much and how easily could be controlled the number of colors , and chosen the colors.

I think may be interesting , for further manipulation a option to have each color on its own layer
(i.e. to outline each color blocth, or to soften the transitions etc)

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 11:21 am  (#6) 
Offline
Script Coder
User avatar

Joined: Nov 06, 2012
Posts: 239
Location: Italy
It looks promising and interesting at least in reading the description and seeing the "work in progress" snapshots attached.
Anyway, whatever will be the final result, every effort aimed to improve GIMP with useful plugins is always appreciable and welcome according to me. :)

_________________
Gino D's GIMP scripts: https://sites.google.com/site/ginodonig/gimp-scripts


Top
 Post subject: Re: Custom values posterization
PostPosted: Wed Nov 20, 2013 6:48 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
i made a thread about posterization versus indexed colours a couple of weeks ago

viewtopic.php?f=9&t=8726

maybe thats of interest to you


Top
 Post subject: Re: Custom values posterization
PostPosted: Thu Nov 21, 2013 6:09 am  (#8) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Thanks for all feedbacks, in general, I found out nothing new. I think that this technics is not very perspective. Peoples would prefer algorithm that creates let us say 7 distinct colors and not 7^3 colors :)

Anyway, python script exists - anybody can contact me for it, or if anybody has any ideas...

Yet, I attach last example - I have a 'force B/W' option in my script where algorithm force 0 and 255 values for each channel, so if level of posterization is 2, as here on this photo, all colors are combination of 0 and 255 values, so basically 8 colors are used here in this example (zoom in to verify :) )


Attachments:
post_img_6524-L2_D0.7_BW.png
post_img_6524-L2_D0.7_BW.png [ 742.78 KiB | Viewed 3499 times ]
Top
 Post subject: Re: Custom values posterization
PostPosted: Thu Nov 21, 2013 6:00 pm  (#9) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Esper wrote:
i made a thread about posterization versus indexed colours a couple of weeks ago

http://www.gimpchat.com/viewtopic.php?f=9&t=8726

maybe thats of interest to you


Well I borrowed the photo from this page (the head only, I failed to find a link for entire image) and the result is attached.

In fact I just added posterization in LAB to my script, obviously colors are much less distorted in LAB mode then in RGB mode.

Of course no modification were done before neither after posterization...
Attachment:
File comment: LAB colorspace posterization, level=4
post_gimp-tutorial-lio-L4-LAB.png
post_gimp-tutorial-lio-L4-LAB.png [ 44.95 KiB | Viewed 3462 times ]


And another example of LAB posterization
Attachment:
File comment: LAB colorspace posterization, level=4
post_img_5380-L4-LAB.jpg
post_img_5380-L4-LAB.jpg [ 513.16 KiB | Viewed 3462 times ]


Top
 Post subject: Re: Custom values posterization
PostPosted: Thu Nov 21, 2013 7:37 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2770
tibor95 wrote:
Well I borrowed the photo from this page (the head only, I failed to find a link for entire image) and the result is attached.
you can find the original image here:
http://de.pasani.wikia.com/wiki/Boyevan ... _01tfk.jpg

tibor95 wrote:
Anyway, python script exists - anybody can contact me for it, or if anybody has any ideas...

you see i dont really understand much of the technical stuff you are talking about
i like the posterization effect and use it sometimes and as you can see from the link that i posted, there are some people who would be interested in your work
i mean there is a whole forum dedicated to people who like to do stencil graffiti, and they will probably be very happy with your plug-in

so why dont you just post it, so people can try it ?
i would certainly appreciate it !


Top
 Post subject: Re: Custom values posterization
PostPosted: Fri Nov 22, 2013 3:38 am  (#11) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
Allright, here is the link to my google drive

But this is not a gimp plugin! So far it is python script, so you need linux machine (preffereably), python3.0+, numpy and colormath (python module, install with 'easy_install colormath').

Read top of the file for more instructions.

Yes, it is no much usage-friendly, but this is a prototype...

LAB mode is very slow, but even-posterizer.py can processes images in batch mode that is a compensation for a speed to some degree.

=EDIT=

All scripts are available via subversion:

svn checkout http://python-posterize-dithering-tools.googlecode.com/svn/trunk/ .


(this will put the files into current directory)


Attachments:
post_Sumatran_tiger_male_01tfk-L4-LAB.png
post_Sumatran_tiger_male_01tfk-L4-LAB.png [ 235.86 KiB | Viewed 1528 times ]


Last edited by tibor95 on Sat Dec 07, 2013 5:16 pm, edited 1 time in total.
Top
 Post subject: Re: Custom values posterization
PostPosted: Fri Nov 22, 2013 9:53 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12535
Another approach you can try is vector simplication. I used Autotrace (no longer works in Win7; have my handy-dandy XP VM though). Can also try using the tracing capabilities within Inkscape. :)


Attachments:
Sumatran_tiger_male_01tfk.jpg
Sumatran_tiger_male_01tfk.jpg [ 192.5 KiB | Viewed 1511 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Custom values posterization
PostPosted: Sat Dec 07, 2013 5:13 pm  (#13) 
Offline
GimpChat Member

Joined: Sep 22, 2013
Posts: 27
In the meantime I did some changes and improvments to my scripts, prepared a homepage: http://code.google.com/p/python-posteri ... troduction with examples and instructions for download and use.


Just note, they are python scripts so linux is almost a must... Also, they are slow, very slow...

Below are two examples where "cleaning" was used to remove discrete spots and so on


Attachments:
File comment: posterization
Street-0.3.png
Street-0.3.png [ 476.13 KiB | Viewed 1471 times ]
File comment: posterization
Sumatran_tiger_male_01tfk_Q11_m0.6.png
Sumatran_tiger_male_01tfk_Q11_m0.6.png [ 277.61 KiB | Viewed 1471 times ]
Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Can this be used for Custom Font?

5

No new posts Attachment(s) custom font

8

No new posts Custom curves files

3

No new posts Attachment(s) Uzu's custom resources volume I

11

No new posts Attachment(s) Custom Fonts for 2023

728



* Login  



Powered by phpBB3 © phpBB Group