New GRF Help!

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
Trolley Trev
Engineer
Engineer
Posts: 45
Joined: 26 Dec 2006 12:12

New GRF Help!

Post by Trolley Trev »

Hi all.

I'm not sure if this is the right forum to post or whether it would be better in tech discussion, but...

I am currently working on my first ever New GRF but I have a little problem... I can't get it to compile! I am coding in NML and using the nmlc tool to (attempt to) create the .grf file.

So far, all the coding errors that have come up on compile I have been able to fix, but it keeps throwing up a "Cannot identify image file" error. The only time I was able to get it to compile successfully was when out of frustration I made the entire .png file "transparent" blue.

I created the PNG in Paint.net (using the right colours in the DOS palette) but after realising it couldn't create the required paletted file, I downloaded GIMP and the DOS palette for it. I then imported my PNG file into GIMP and converted it to indexed. For the life of me, I just can't figure out what's wrong with it!

I have attached the PNG file if anyone has any ideas!

Thanks in advance for any insights!
Attachments
A Set.png
A Set.png (23.57 KiB) Viewed 2146 times
juzza1
Engineer
Engineer
Posts: 95
Joined: 22 Oct 2004 19:27

Re: New GRF Help!

Post by juzza1 »

Your png file is malformed enough for Pillow (the image library used by nmlc) to complain about it. Pillow is usually pickier than image viewers, so it still renders in Gimp and other programs. Re-exporting your image as png in Gimp (2.10.10) fixed the problem on my machine.

Edit: I managed to get the error myself by selecting both "Save color profile" and a combination of other export settings in the Gimp png export dialog. It's probably related to this bug: https://gitlab.gnome.org/GNOME/gimp/issues/2111. Uncheck "Save color profile" if you had it enabled.
Trolley Trev
Engineer
Engineer
Posts: 45
Joined: 26 Dec 2006 12:12

Re: New GRF Help!

Post by Trolley Trev »

Ok, I will try it out tonight when I get a chance. Thankyou for your help. :))
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: New GRF Help!

Post by kamnet »

As an alternative, you could also try coding your NewGRF for 32bpp, which basically gives you a 24 million color palette, and should thus end the complaints. :)
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: New GRF Help!

Post by Erato »

kamnet wrote:As an alternative, you could also try coding your NewGRF for 32bpp, which basically gives you a 24 million color palette, and should thus end the complaints. :)
You'd still need to provide 8bpp sprites so you just added more complexity, instead of removing it.
No pics no clicks. Seriously.
ImageImageImageImageImageImage
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New GRF Help!

Post by Pyoro »

Also, with saving in GIMP, don't forget to turn off "remove unused and duplicate colors" (or something to that effect) when switching modes to Indexed. That saves only the palette color actually used instead of the full palette, which causes NML to complain about incorrect palette.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: New GRF Help!

Post by kamnet »

Erato wrote:
kamnet wrote:As an alternative, you could also try coding your NewGRF for 32bpp, which basically gives you a 24 million color palette, and should thus end the complaints. :)
You'd still need to provide 8bpp sprites so you just added more complexity, instead of removing it.
Well, only if you care about company colors...

... which, now that I think about it and looked at the graphics, probably does care about it...

... ooops. :P
Trolley Trev
Engineer
Engineer
Posts: 45
Joined: 26 Dec 2006 12:12

Re: New GRF Help!

Post by Trolley Trev »

I re-exported without color management as you suggested and that fixed my problem. Many, many thanks! :bow:
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 7 guests