Using an image as palette

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
luskos
Posts: 2
Joined: Sat Feb 27, 2021 8:08 pm

Using an image as palette

Post by luskos »

Is it possible to use one image as a palette to replace colors in another with approximation? If yes, how?
Alex
Site Admin
Posts: 1921
Joined: Thu Jul 10, 2008 2:21 pm

Re: Using an image as palette

Post by Alex »

Hello,
Is it possible to use one image as a palette to replace colors in another with approximation? If yes, how?
ChangePixelFormatToPaletteCommand class allows to convert image to palette image with specified color palette.

For solving your task you need to do the following steps:
  • Get color palette from image.
  • Convert an input image to the palette image with specified color palette.
Best regards, Alexander
luskos
Posts: 2
Joined: Sat Feb 27, 2021 8:08 pm

Re: Using an image as palette

Post by luskos »

I am getting Unsupported pixel format error. On top of that BGR32 does not support palette as i found out, and one of the parameters is just that, a palette. It might be possible to use ReplaceColor comand.
Alex
Site Admin
Posts: 1921
Joined: Thu Jul 10, 2008 2:21 pm

Re: Using an image as palette

Post by Alex »

Hello,
I am getting Unsupported pixel format error. On top of that BGR32 does not support palette as i found out, and one of the parameters is just that, a palette.
If you have BGR32 image, you need to get unique colors from first BGR32 image, get unique colors from second BGR32 image, create algorithm that allows to convert color from second image into color from first image, change pixels in second image.

VintaSoft Imaging .NET SDK allows to open image and get/set pixel in image. All other functionality must be developed by yourself.

Best regards, Alexander
Post Reply