Apply palette with imagemagick?

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
oftcrash
Transport Coordinator
Transport Coordinator
Posts: 304
Joined: 03 Jan 2013 17:20
Location: New England, USA

Apply palette with imagemagick?

Post by oftcrash »

I create most of my sprites in Pixeltool, then usually have to go into Photoshop to apply the palette. I'd love to do that in Imagemagick, but before I start digging into that, has anyone had any luck getting it to work?
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Apply palette with imagemagick?

Post by Eddi »

can't pixeltool apply the correct palette in the first place?
User avatar
oftcrash
Transport Coordinator
Transport Coordinator
Posts: 304
Joined: 03 Jan 2013 17:20
Location: New England, USA

Re: Apply palette with imagemagick?

Post by oftcrash »

I don't think so. I always have to run them through photoshop to apply the palette. The Pixeltool images are RGB, since they are just generated in the browser.
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Apply palette with imagemagick?

Post by V453000 :) »

I wrote RGBA Eater to convert 32bpp into 8bpp, but it can also be used to just set a palette of a file. I'm not sure how exactly it will behave if your image has no alpha, I have to test that.

You can download/check out the repository here:

https://github.com/V453000/RGBA-Eater

The usage isn't mega-friendly yet but it works. You just need python 3 with pillow installed. If you have some specific problems I can try to address them. :)

EDIT: I added support for RGBA without alpha.
ImageImageImage
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests