English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to load some ARGB images, convert them to 256 color with alpha value(I just need an alpha value of 1 or 0 not a whole channel) , and then write a png out of those. If i just create a BufferedImage with an IndexedColorModel, the result looks bad, so I have to apply some quantization algorithms to get the best palette for the image. How can I create an optimized palette, and how can I create a new bufferedImage out of this?
What java classes can I use for this purposes, and please wirte me a concrete example how to do it too!

Thanks!

2007-02-13 22:01:01 · 3 answers · asked by szabo l 1 in Computers & Internet Programming & Design

3 answers

Well. What you ask for is involved; consider looking on Krugle.com (Google code search).

To make something look good in 256 colors, you need a decent quantization method, to boil down your mega-zillion color image to the 256 colors that are most important.

256 as a rule does not support alpha channeling, but I'm not familiar (although I've heard of) the PNG format, so I don't know how alpha channels apply. They should be easy, though - take the channel, and if it's over a particular threshold (presumably 128 or 0x080),z then it's a 1, otherwise it's 0, but where it gets written in PNG I don't know.

The quantization is trickier. Keep in mind that if you've quantized it correctly but haven't applied the palette to the video card (or otherwise specified or stored the palette) it'll probably be redisplayed using the default system palette, which is notoriously crap. So you might be doing most of it right, just not displaying it correctly.

Good luck.

2007-02-13 22:10:33 · answer #1 · answered by T J 6 · 0 0

Many thoughts are available in. With Adobe Photoshop software you may do miracles such as your photos. different simplest way is only convert the picture resources or mode to gray Scale. the picture will immediately turn to B&W.

2016-11-03 10:12:47 · answer #2 · answered by Anonymous · 0 0

your personal success on the internet hinges on your skill. remember that it involves your business, google and your clients. you might want to learn how to do the search engine optimization of your website so as to win the like of the search engines with your clients.

2015-01-10 07:34:30 · answer #3 · answered by Todd 2 · 0 0

fedest.com, questions and answers