How to convert a pattern/photo to a given palette?
How would I convert a photograph or pattern to use only colors from a palette I give it? Is this possible in Photoshop? I think Pic2Color used to do something like this but it's offline...
Yes it is possible, and very easy to do: Image > Mode > Indexed Color: Here you can switch the Palette to "Custom", pick number of colors in the palette and few other options.
Photoshop will then ask you to flatten the image for the conversion.
We have arrived at the crime scene. Here you can change various options, e.g., if you were creating a new palette.
For the pre-defined palette, we'll have to go for the topmost option and select "Custom..." to get the file selection menu open.
Photoshop has already generated a suggestion palette for your image, but since we'll be using a pre-defined palette, we'll go for the "Load..." button at the right side of the custom palette menu.
Now we are dealing with the murded weapon. I have my pre-defined palette here, saved using Photoshop default file format ".ACT". Photoshop also understands .ACO and .PAL - if your palette is in different format, you might enter *.* in the "File name" box and just try to use it (works only if the palette actually is one of these formats but is renamed to avoid abuse or something...) OR convert it to one of the supported formats. (Don't know any tools for that ATM, never had to convert palettes.)
Now this here is the custom palette I have. One thing to keep in mind as we progress: This palette here is not very suitable for the picture we are using it with. But it demonstrates the change of palette and dither options well. You could manually adjust the colors here by double clicking the representing squares. Useful in case you have to have a #FF00FF for transparency at the index #0 or stuff like that.
You will propably want to adjust the dither options in case the palette you are using doesn't fully support the given image. Options are diffusion, pattern and noise. In the previous picture we were using Diffusion. Here is Pattern:
Here is the last option, Noise. I'll stick with this, just because the gradient pleases me the most. If you have a lot of pictures where obvious dithering happens, you might want to keep the same option for the same project for the sake of consistency, but that's up to you.
Ok, the crime has happened now. The decisions were made and here are the results. If I had chosen, e.g., one of the palettes photoshop suggests me to go with (3rd picture, Local or Master(Perceptual, Selective or Adaptive)) the dithering would be minimal and the change from 24bit colorspace to indexed palette almost unnoticeable (at least for the untrained eye, har har) but since my palette was almost the worst match possible we get to witness the grains of dither:
I hope this helps.