 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daniel Guest
|
|
| Back to top |
|
 |
Joris Van Damme Guest
|
Posted: Wed Oct 12, 2005 10:10 am Post subject: Re: Oil Painting effect |
|
|
Daniel,
Daniel wrote:
The basis of this effect is called posterization.
The trick is to convert all colors to the nearest color in a limited
palette.
Usually, in other applications, this is done with dithering, which mean you
bring the error in one pixel to the neighbouring pixels before rounding
those neighbouring pixels, so as to try and compensate an error in one pixel
with opposite errors in neighbour pixels, so as to minimize overall image
error.
In this posterization, however, you don't dither. This means that a complete
shape with all sorts of close tints of some brown, all get converted to the
same brown. Hence the posterization effect.
Posterization works best if the actual palette is good. Various tricks to
come up with a pleasing palette, is quantization to a very limited palette,
or simply using a palette that is equally spaced in some color space.
Often times, the effect can also made more pleasing by applying a gaussian
blur before the posterization algorithm.
So, depending on what this is worth for you, you could spend a day or a week
on this... Start with googling on 'posterize', 'quantize', and 'guassian
blur'.
--
Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html
|
|
| Back to top |
|
 |
Daniel Guest
|
Posted: Wed Oct 12, 2005 1:20 pm Post subject: Re: Oil Painting effect |
|
|
| Quote: | The trick is to convert all colors to the nearest color in a limited
palette.
Posterization works best if the actual palette is good.
|
I can convert image in less colors, but not in few colors (less than 256),
means I didn't get a good pallette. Any source code available?
I tried to resample each pixel color by reference its neighbors pixels ( n*n
array). But the bigger the n is, the longer the time will takes. The result
is good, but the time is too long.
Is there any source available of Posterization?
thanks.
Daniel
"Joris Van Damme" <PleaseReplyTo (AT) TheGroupInstead (DOT) be> ¼¶¼g©ó¶l¥ó·s»D:434ce01e$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Daniel,
Daniel wrote:
I've been searching this for a long time but in vain. May anyone
help? How to process an Image to an Oil-Painting like one.
EX:
Original
http://delphi.ktop.com.tw/download/upload/79665_0.bmp
Oil Painting Effect
http://delphi.ktop.com.tw/download/upload/79667_g.bmp
The basis of this effect is called posterization.
The trick is to convert all colors to the nearest color in a limited
palette.
Usually, in other applications, this is done with dithering, which mean
you
bring the error in one pixel to the neighbouring pixels before rounding
those neighbouring pixels, so as to try and compensate an error in one
pixel
with opposite errors in neighbour pixels, so as to minimize overall image
error.
In this posterization, however, you don't dither. This means that a
complete
shape with all sorts of close tints of some brown, all get converted to
the
same brown. Hence the posterization effect.
Posterization works best if the actual palette is good. Various tricks to
come up with a pleasing palette, is quantization to a very limited
palette,
or simply using a palette that is equally spaced in some color space.
Often times, the effect can also made more pleasing by applying a gaussian
blur before the posterization algorithm.
So, depending on what this is worth for you, you could spend a day or a
week
on this... Start with googling on 'posterize', 'quantize', and 'guassian
blur'.
--
Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|