Jump to content

Can you convert full color images to a limited color palette in PDN?


Recommended Posts

Tried to make this post as clear and concise as possible while including specific context as to what led me to my question(s) 😅

 

So I was playing around with a program I found on my old computer (~2009, running Windows 7) called unLZ-GBA. This program reads .ROM files and basically helps you find find sprites and export them as image files. Here's the interface:

 

un-LZ-GBA-INTERFACE.png

 

It gives you a preview of the sprite and in the lower right-hand corner it shows you the 16 color palette used for the sprite.

 

Long story short... when you save a sprite as a .PNG file and then open it in MS Paint, in addition to importing the image, it also appears to import the image's color palette. (MS Paint for XP that is, doesn't work in MS Paint for WIndows 7)

 

So let's say I export this sprite from the .ROM to my computer as a .PNG file using unLZ-GBA:

 

SHROOMISH-SPRITE.png

 

After exporting the .PNG file to my computer, I open it in MS Paint.

 

Now that I have the .PNG open in MS Paint I can take any image and paste it into the project. For this example I found an image that was predominantly green, tan, white and black:

 

LEAF-ON-SAND-ORIGINAL.png

 

Once I paste it in the same project as the sprite I get this:

 

LEAF-ON-SAND-16-COLOR.png

 

It automatically converted the full color image to the 16 color palette of the sprite. You can see each of the image's original colors is converted to the color closest to it in the 16 color palette (or at least I'm guessing that's what's going on).

 

So here are my questions:

 

> How does this work? Why is it that these .PNG files come with their own built-in color palettes?  Why do these color palettes only seem to remain intact in MS Paint XP and not modern graphic editors? Is it possible to create my own .PNG files that have built-in color palettes? Can I customize these palettes to any colors I want? Is this limited to 16 colors or could it be expanded to a 96 color palette for use with PDN color palettes?

 

> Can you do this in PDN? Is there any way to convert a full color image to a specific custom palette of colors in PDN? (I know you can reduce the number of colors through TR's Color Reducer, but I'm looking for conversion to a specific palette of colors not just reduction.) If not in PDN, is there any other (free) program that can do this?

 

*If you couldn't already tell I have no education in regards to computers, graphic design, etc. I'm guessing this is a relatively simple concept but I can't seem to find any relevant info on the web (I swear Google is not what it used to be) so any insight would be greatly appreciated!*

Link to comment
Share on other sites

Paint.NET G'MIC QT can convert image to a palette, and I have already made a filter a while ago which allows you to convert pictures to reduced colors picture using a reference picture, but that appears to be not what you want.

 

This below should really be turned into a filter, rather than a command

G'MIC QT -> code local -> colormap

Reference - https://gmic.eu/tutorial/_colormap.shtml

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

7 hours ago, Elion said:

I'm looking for conversion to a specific palette of colors

Hi @Elion

Welcome to the forum. Have you looked at this plugin?

After using TR:s color reducer to create the palette, use this plugin to apply the colors to your original image. If you have a custom palette built already you can use that as well.

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...