How to manipulate images with command line tool properly?

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

How to manipulate images with command line tool properly?

Post by Wahazar »

I need to merge some pair of images into new one.
I thought, that imagemagick convert tool would be sufficient to perform this task more or less automatically, unfortunately output is either RGB or with optimised palette, not suitable for TTD.
I tried options like -map palette.png or -define png:preserve-colormap but aparently they doesn't work properly even for newest version of imagemagick (I make query on imagemagick forum, these options are recognised but not implemented).

Are there any other tools for images manipulation without loss of proper palette?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: How to manipulate images with command line tool properly?

Post by Supercheese »

You can use the existing tool(s) to process your images as needed, and if they pop out in RGB or with the wrong palette, you can then batch re-palettize them using this GIMP script: http://www.tt-forums.net/viewtopic.php? ... 80#p934898
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: How to manipulate images with command line tool properly?

Post by Wahazar »

Supercheese wrote:You can use the existing tool(s) to process your images as needed, and if they pop out in RGB or with the wrong palette, you can then batch re-palettize them using this GIMP script: http://www.tt-forums.net/viewtopic.php? ... 80#p934898
Sound interesting, but seems that this script doesn't work - it shut down quietly, images are untouched.
I tried to run from script console, it return only ()
I'm using gimp 2.6.
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: How to manipulate images with command line tool properly?

Post by V453000 :) »

Python snake is your friend. :)
ImageImageImage
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: How to manipulate images with command line tool properly?

Post by Wahazar »

Ugh, simply job, just batch convert from rgb to indexed and nothing relevant exist... I found plethora of broken gimp scripts and unanswered question about imagemagick bugs.
Finally I found this:
http://members.ozemail.com.au/~hodsond/dbp.html
after some changes and compiling, it works.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot] and 19 guests