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: 299
Joined: 03 Jan 2013 17:20
Location: New England, USA

Apply palette with imagemagick?

Post by oftcrash » 12 Feb 2019 19:35

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: 7398
Joined: 17 Jan 2007 00:14

Re: Apply palette with imagemagick?

Post by Eddi » 20 Feb 2019 21:00

can't pixeltool apply the correct palette in the first place?
You might not exactly be interested in Ferion, but if you are, have fun :)

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

Re: Apply palette with imagemagick?

Post by oftcrash » 21 Feb 2019 17:23

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: 947
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Apply palette with imagemagick?

Post by V453000 :) » 08 Apr 2019 11:46

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