Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Image colors palette (https://www.delphipraxis.net/167615-image-colors-palette.html)

WojTec 9. Apr 2012 16:11

Image colors palette
 
I want to get colors palette from image, like cssdrive.com/imagepalette or bighugelabs.com/colors.php.

I did it by random pixels from image (looks to be very lame method) and with GIFImg.pas.ReduceColors() (very slow).

Could you share more solutions if you know some?

:)

Medium 10. Apr 2012 01:44

AW: Image colors palette
 
What images? There are those, that come with an associated palette, and others that have none at all. From the latter you may derive a palette, but then the question is, what restrictions you need/want to apply to it (color space, number of colors, etc.), and if it is okay to thereby reduce the image's color depth (i.e. make a 256-color paletted image from a 24-bit true color one). Then, maybe even dithering comes into play, and more so palette optmizations, which are actually not that trivial if done well. Or do you not need to actually change the image itself but simply obtain a "most common colors and shades"-table?

So. What exactly do you want/need to achieve? What is your readily available base data, and what do you need to output?

WojTec 10. Apr 2012 17:12

Re: Image colors palette
 
I want to do something like services from above links.
Also reduce image to 256 colors.
Also get all distinct colors.

Image is loaded to TBitmap32.

Medium 10. Apr 2012 22:58

AW: Image colors palette
 
That would be a rather wide field of theory, since one can go about this process in a large amount of different ways that differ greatly in complexity and quality of the results, and is highly dependent on the desired output format (how many colors per palette, format of the colors inside the palette, fixed colors from preset palettes or partial palettes to consider, etc.).
These three articles may give you a decent entry point: This one surely will, that will come up fast and that here gives a rather coarse but useful text to get you accustomed to some of the terminology you will come across.

PS: I'd be interested in the Photoshop-Clone you/we program here. It would be nice to see a version on here one day :)

PPS: It still is unclear waht the source images are, but I assume it's going to be "arbitrary". G32 transforms everything into 24/32 Bit RGB color space anyways if I recall correctly. But beware! Especially when it comes to (semi-)professional use, 24/32 Bit images is not the high end, and many formats desired by printing companies/processes may not even be supported by G32, nor would they be able to be worked with using G32 properly. There even are image formats out there, that work with colors represented by float values, maybe even CMYK and others, and to make things worse: Color-profiles. There you should ask yourself how professional you want to get (or what your audience is).


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz