Page 1 of 1

Using an image as palette

Posted: Sat Feb 27, 2021 8:11 pm
by luskos
Is it possible to use one image as a palette to replace colors in another with approximation? If yes, how?

Re: Using an image as palette

Posted: Mon Mar 01, 2021 11:36 am
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

Re: Using an image as palette

Posted: Mon Mar 01, 2021 2:38 pm
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.

Re: Using an image as palette

Posted: Tue Mar 02, 2021 2:09 pm
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