tannerhelland / PhotoDemon

A free portable photo editor focused on pro-grade features, high performance, and maximum usability.
https://photodemon.org
Other
1.35k stars 199 forks source link

Suggestion: Built in 'Retro' palette effects. #249

Open Kroc opened 6 years ago

Kroc commented 6 years ago

I wanted to do some batch conversion of images to particular palettes, but PhotoDemon isn't really designed for indexed-colour work (it doesn't have to); but this led me to think that some neat special effects you could add easily would be some 'Retro' filters that palletize an image to suit a particular hardware-platform's limitations. See https://en.wikipedia.org/wiki/List_of_color_palettes but particularly the sub-pages for "8/16-bit computer hardware palettes" and "videogame console palettes".

NB: On the more powerful systems, there are few restrictions other than the number of colours available per-pixel, but on weaker (typically 8-bit) systems, there are restrictions on the number of colours that can be used in any 8x8 area. For simplicity's sake you could choose to ignore these restrictions, but a future version could perhaps support restrictions for those perhaps wishing to convert images to actual hardware, e.g. C64.

tannerhelland commented 6 years ago

This is a great suggestion, Kroc. Thank you.

90% of the required code is already available thanks to the Effects > Stylize > Palettize menu. To complete a new "Retro" effect, I guess we'd still need:

I can manually produce palette files from the Wikipedia page you mention, obviously, but if you already have any palettes on-hand (or know of a good online collection), that would be a huge help, too. Thanks in advance.

Kroc commented 6 years ago

Try here: the author has taken them from the Wikipedia article and made Photoshop palette files: http://fornaxvoid.com/colorpalettes/

Kroc commented 6 years ago

It just occurred to me that in the absence of an already existing palette file, you could write a function to produce a palette by counting the unique colours in an image -- you already have half the code. That way you can download the Wikipedia samples and just produce the palettes quickly. It'll also make the process easier if someone requests another palette in the future, just find any sample picture.

tannerhelland commented 6 years ago

Perfect, thank you! Both suggestions are great.

Kroc commented 6 years ago

Just discovered this highly interesting tool for 'retro-izing' images; could be a source of some inspiration: https://kronbits.itch.io/pixatool