Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

color reduction tool


color reduction tool

Postby StephC » Jun 22, 2003 @ 4:17pm

Is there a *good* (and free) tool to reduce colors to 16 (565) and 12 bits ?

Please don't mention Photoshop or Paint Shop Pro...
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby DillRye » Jun 22, 2003 @ 7:45pm

you could try "the gimp". Its a free open source alternative to photoshop/paint shop pro. Im pretty sure theres a version for windows.
User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby sponge » Jun 22, 2003 @ 8:40pm

The Gimp has a windows port, GTK is included. Other than that, PSP is the best solution, you might just have to shell out for it.
holy internets batman.
User avatar
sponge
Not sponge
 
Posts: 12779
Joined: Jan 13, 2002 @ 8:04am
Location: New Hampshire


Postby Sm!rk » Jun 22, 2003 @ 9:02pm

I use Debabelizer for all my image conversion, its a commercial product however ($450).
User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby Digby » Jun 23, 2003 @ 1:18am

Why would you want to convert an image to 12 bits?
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby StephC » Jun 23, 2003 @ 11:23am

Digby wrote:Why would you want to convert an image to 12 bits?


Old devices (ipaq 36xx and 37xx) have 12bits screens (4096 colors).

16 bits pictures are not perfectly rendered on 12 bits screens...

For now I'am trying to use ImageMagick, it's color reduction algorithm seems to be very efficient and versatile.
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby Dan East » Jun 23, 2003 @ 1:30pm

It's a shame to compromise the quality for all devices, just for a limitation found on only 10% of the devices. 12 bit really looks bad compared to 16 bit in most cases.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Guest » Jun 23, 2003 @ 2:01pm

Dan East wrote:It's a shame to compromise the quality for all devices, just for a limitation found on only 10% of the devices. 12 bit really looks bad compared to 16 bit in most cases.

Dan East


I do not want to compromise the quality for all devices, I want to release 16 bits AND 12 bits versions.
Guest
 


Postby Digby » Jun 23, 2003 @ 4:29pm

The 12 bit devices have 16 bit frame buffers, or am I missing something?
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby StephC » Jun 23, 2003 @ 8:27pm

Digby wrote:The 12 bit devices have 16 bit frame buffers, or am I missing something?


12 bits devices HAVE 16 bits frame buffer, but they can't display all the 65536 colors... only 4096 of them.
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby Dan East » Jun 23, 2003 @ 8:38pm

Yes, so it uses the closest color. The 16 bit to 12 bit conversion is done at the hardware level. Are you wanting a converter that will dither the images to decrease banding? That is the only point I can see in pre-processing the images to 12 bit. Even so, I would prefer to do the dithering at load-time for the devices that need it (assuming I could find such an algorithm).

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Kzinti » Jun 23, 2003 @ 10:31pm

Dan East wrote:Even so, I would prefer to do the dithering at load-time for the devices that need it (assuming I could find such an algorithm).


I would also like to do that. But how does one detect such devices? The only way I know is to explicitely detect the iPAQ 36xx devices. Are there any others with 12 bits display?
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Dave H » Jun 24, 2003 @ 12:08pm

Thierry wrote:
Dan East wrote:Even so, I would prefer to do the dithering at load-time for the devices that need it (assuming I could find such an algorithm).


I would also like to do that. But how does one detect such devices? The only way I know is to explicitely detect the iPAQ 36xx devices. Are there any others with 12 bits display?


As a halfway compromise without going to too much effort, I just applied a bit of random noise to my 16-bit graphics. This looks alright on 12-bit devices (because it provides a bit of stipple) and 16-bit devices (the noise doesn't look too bad, just looks textured).

I'm too lazy to specifically target 12-bit and 16-bit, I'd rather spend my effort targetting 4-bit like Triums and 31xxs ;)
Dave H.
Lead Programmer (Repton PPC/7650)
[url=http://www.handango.com/PlatformProductDetail.jsp?productId=43741]
Buy Repton Online here!
[/url]
User avatar
Dave H
pm Member
 
Posts: 164
Joined: Oct 3, 2002 @ 5:01pm


Postby StephC » Jul 16, 2003 @ 5:50am

So, I've made an implementation of ordered dithering for 16 and 12bits :

This may be useful to generate smooth gradients etc..

Enjoy :)

Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
Uint32 dither4[4][4] = { {0, 4, 1, 5}, {6, 2, 7, 3}, {1, 5, 0, 4}, {7, 3, 6, 2} };

PIXEL Dither16(Uint32 x, Uint32 y, Uint32 Red, Uint32 Green, Uint32 Blue)
{
  Uint32 dither;
  Uint32 pRed, pGreen, pBlue;

  dither = dither4[y&3][x&3];

  pRed   = Red  >>3;
  pGreen = Green>>2;
  pBlue  = Blue >>3;

  if((dither < Red&7)   && pRed   < 31) { pRed   = pRed++;    }
  if((dither < Green&3) && pGreen < 63) { pGreen = pGreen++;  }
  if((dither < Blue&7)  && pBlue  < 31) { pBlue  = pBlue++;   }

  return (pRed << 11) | (pGreen << 5) | (pBlue );

}

/////////////////////////////////////////////////////////////////////////////////

PIXEL Dither12(Uint32 x, Uint32 y, Uint32 Red, Uint32 Green, Uint32 Blue)
{
  Uint32 dither;
  Uint32 pRed, pGreen, pBlue;

  dithy = y & 0x3;
  dithx = x & 0x3;

  dither = 2*dither4[y&3][x&3];

  pRed   = Red  >>4;
  pGreen = Green>>4;
  pBlue  = Blue >>4;

  if((dither < Red&15)   && pRed   < 15) { pRed   = pRed++;    }
  if((dither < Green&15) && pGreen < 15) { pGreen = pGreen++;  }
  if((dither < Blue&15)  && pBlue  < 15) { pBlue  = pBlue++;   }

  return (pRed << 12) | (pGreen << 7) | (pBlue<<1 );
}
43 lines; 8 keywds; 48 nums; 220 ops; 0 strs; 1 coms    Syntactic Coloring v0.4 - Dan East  

PS : isn't "code" section buggy ? (I use Opera)
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby Dan East » Jul 16, 2003 @ 10:12am

Thanks for sharing your code.

StephC wrote:PS : isn't "code" section buggy ? (I use Opera)


No, it's been fixed (however there is a report of an issue with IE 5).

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

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 post attachments in this forum