ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to build a palette from pixel selected

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Jun 09 2018 : 03:00:41
Hello,

I am trying to build a color palette from a 8bit image based on selected pixels.

How can I achieve this?

TIA


Yogi Yang
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 24 2018 : 22:46:45
Hi Yogi

The Palette demo uses AssignPalette, which shows all the colors of the image's palette, even those not being used. You need to use CalcImagePalette, to only get those in use.

Anyway, for v8.0.0 ready before the end of the week, I've added a parameter to AssignPalette to show only the used colors.

Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Jun 22 2018 : 01:22:21
I am attaching three sample images for testing.

Just compile and start the demo app (Demos\ImageAnalysis\Palette\Palette.exe)

Open each file and see what comes up in the color palette.

It show many colors which just does not exist in the image!

TIA

attach/yogiyang/20186221225_ImageSwatches.zip
14.27 KB


Yogi Yang
xequte Posted - Jun 21 2018 : 18:48:24
Hi Yogi

Your code looks correct. What problem does it give you? Please post an example image too.


Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Jun 20 2018 : 02:22:13
Hello,

The code that I am using:

// Load images in native format
ImageEnView1.IO.NativePixelFormat := true;
with ImageEnView1.IO do
    LoadFromFileAuto( ExecuteOpenDialog());
// if the bitmap is not 8 bit paletted then convert it
if ImageEnView1.IEBitmap.PixelFormat <> ie8p then
    ImageEnView1.IEBitmap.PixelFormat := ie8p;
//Build the Palette
IEColorPalette1.AssignPalette( ImageEnView1 );


I also tried out: CalcImagePalette

But the result is the same.

TIA


Yogi Yang
xequte Posted - Jun 12 2018 : 16:30:44
Please show me your code.



Nigel
Xequte Software
www.imageen.com
yogiyang Posted - Jun 11 2018 : 00:29:07
Hello Nigel,

Thanks for the tip. I tried that but what I am getting is not acceptable.

The image that I am using for testing is attached here. In the attached image just select a small portion of the image like say the RED color square and generate a palette. It contains many colors and some of the colors are just not possible in a red color pixels.

TIA




Yogi Yang
xequte Posted - Jun 10 2018 : 19:36:08
Hi Yogi

How about if you copy the selection to a bitmap and use CalcImagePalette:

https://www.imageen.com/help/TImageEnProc.CalcImagePalette.html

Nigel
Xequte Software
www.imageen.com