PNGCodec

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

User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 623
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

Well it's not pngcodec that is broken, but the compile farm did something wrong.

Attached a working win32 pngcodec.

Edit: after reading the pngcodec compile logs, it seems the compile farm builds all version with its local g++ instead using the "host" one.

[Edit TrueLight] Compiled executables are now correct [/Edit]
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

That would indeed be a problem. I suppose that means that all the pngcodec builds, except for the x86 Linux one, are broken?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

Thanks V much for the fix. Hope I my whining helped highlight the problem to some degree... :wink:
NB: the below challenges are still open for submission, so feel free to perform necromancy on them!
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4

Or try my scenario instead!

-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"

Patches:
Company Station Stats
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

Thanks glx.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
QtanJ
Engineer
Engineer
Posts: 21
Joined: 27 Jun 2006 11:52
Location: Europe, Norway

Post by QtanJ »

I made a useless script to manage a lot of pictures at the same time. I thought it worked, but that the 32bpp engine was bugged so I posted it here. When I discovered that I had done something wrong I did a lot of work to try to fix it, and when I finaly decided to check how pngcodec actually worked I found that x_offs=-31 and y_offs=-32 worked. I even tried to use algebra to find out how I should calculate the y_offs from a croped image before I tried this.

The script isn't as useful as I thought when I first began to create it(since it is very simple), but I can provide it anyway, in case someone want to use it. But the only reason I didn't delete this was in case someone saw this post and wondered what the result would look like(someone with the same knowlege about pngcodec as when I started with the script)

Code: Select all

#!/bin/bash 

PNGCODECDIR="/usr/bin"
IMAGEFOLDER="trg1r"
	for i in $( ls $IMAGEFOLDER ); do 
		$PNGCODECDIR/pngcodec r $IMAGEFOLDER/$i x_offs=-31 y_offs=-32
	done
Edit: Replaced all content, because I didn't know what I was doing when I posted the first time, I only thought I did.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

There indeed was a bug on the compile farm, where the compiler of the host was used for all targets. This problem is now corrected and all produced binaries are for the target specified by their name.
The only thing necessary for the triumph of evil is for good men to do nothing.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

QtanJ wrote:(..) x_offs=-31 and y_offs=-32 (..)
Just remember that the x-offs and y-offs can't be -31 by -32 for all images. It depends on the artist and which image he replaces what the offset should be. You might want to look at this list to see the x-offs and y-offs of all original grf images:

http://devs.openttd.org/~truelight/orig ... ffsets.txt

I myself use this script to give all images the offset as they were in the original grfs. This in no way is any guarantee the result looks correct!!!

http://devs.openttd.org/~truelight/orig ... offsets.sh
The only thing necessary for the triumph of evil is for good men to do nothing.
n0k0m
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 17:06

Re: PNGCodec

Post by n0k0m »

Can someone explain me how can i count x and y offs, again?

I tried to make the png with the same size as the original picture was (copied from the original decoded grf file). I used the original picture also (to test it) and the original picture's offs.

Than i used the pngcodec and i added that offs. It said it worked. So i copyed it back to the tar file, made the info (line copyed and modifyed from a working one).

Than add it to the cfg file.

ZOOM error allways...
And i tried it 213312 times, tried to count pixels and looked at many offs and pictures and still... i cant see logic in that (i su*k in math).

So please help :P
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: PNGCodec

Post by Rubidium »

The tar and the extra zoom levels are of the obsolete 32bpp branch (pngcodec is not used there).
pngcodec is used for 32bpp images in trunk.
n0k0m
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 17:06

Re: PNGCodec

Post by n0k0m »

Rubidium wrote:The tar and the extra zoom levels are of the obsolete 32bpp branch (pngcodec is not used there).
pngcodec is used for 32bpp images in trunk.
Oh! Is there a new way to do it? Where can i find a post about how to do it?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: PNGCodec

Post by TrueBrain »

n0k0m wrote:
Rubidium wrote:The tar and the extra zoom levels are of the obsolete 32bpp branch (pngcodec is not used there).
pngcodec is used for 32bpp images in trunk.
Oh! Is there a new way to do it? Where can i find a post about how to do it?
Try the sticky just three posts below this one.... might be useful ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
n0k0m
Engineer
Engineer
Posts: 5
Joined: 20 Jul 2007 17:06

Re: PNGCodec

Post by n0k0m »

Omg, Ban please. I am so blind today :)
LordAzamath
Tycoon
Tycoon
Posts: 1656
Joined: 08 Jun 2007 08:00

Re: PNGCodec

Post by LordAzamath »

Hmm. I was pngcodecing some things and found out that there are image editors that support text fields in. I'm particulary talking about gimp here.
I post the screenshot here.

I don't know is it possible to change that line when saving files

Code: Select all

comment=created with the gimp
but if that can be done (I mean particulary that "comment=" side of that)
then gimpers can codec their pngs w/o pngcodec too.

I mean the comment should be replaced with x_offs or y_offs and the comment itself with proper values. Though I think it would be possible to give it only one field not both x and y :(
I'm not so sure

BTW the 32bpp pngs with that comment work with openttd too. So there is no need of removing these
Attachments
example.png
example.png (35.25 KiB) Viewed 7214 times
PS: And I stopped the propaganda to support Dave Worley since he got a nice new red hat now.[/color]
I know I have a BBCode error in my signature but I really cba to fix it.
BlazE
Engineer
Engineer
Posts: 20
Joined: 09 Aug 2005 08:19
Location: Germany
Contact:

Re: PNGCodec

Post by BlazE »

lordazamath wrote:I don't know is it possible to change that line when saving files
You can change the comment for example with this GIMP plugin:
ecomment
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: PNGCodec

Post by TrueBrain »

lordazamath wrote: BTW the 32bpp pngs with that comment work with openttd too. So there is no need of removing these
OpenTTD ignores all fields besides x_offs and y_offs. So feel free to add any other field you like ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: PNGCodec

Post by Slye_Fox »

Right.

How the hell do i use this dam thing?

I know it's a commandline program, but when i try and do anything on it's list i get this:

Code: Select all

'pngprops' is not recognized as an internal or external command,
operable program or batch file.
What does that mean?

And why doesn't this thing have a manual?
Image
Leviath.NL
Traffic Manager
Traffic Manager
Posts: 152
Joined: 28 Jan 2006 15:00

Re: PNGCodec

Post by Leviath.NL »

What OS are you using Windows XP? What command did you type in? For win32 I think it is

Code: Select all

pngcodec.exe a <filename>.png x_offs=xx y_offs=xx
You could also post your brickland rail sprites (in the brickland thread)and I'll pncodec them for you.
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: PNGCodec

Post by Slye_Fox »

Allready figured out the problem,
I was typing 'pngprops'
Image
User avatar
Wacki
Traffic Manager
Traffic Manager
Posts: 137
Joined: 28 Feb 2007 09:02
Location: Czech Republic
Contact:

Re: PNGCodec

Post by Wacki »

I have a question too:
Attachments
error.PNG
error.PNG (1.57 KiB) Viewed 7585 times
Sorry for my very bad English!!! :(
I am 3dsmax artist.
Slye_Fox
Traffic Manager
Traffic Manager
Posts: 164
Joined: 21 Aug 2004 14:27
Location: London, UK
Contact:

Re: PNGCodec

Post by Slye_Fox »

I think the codec needs to be in the same folder as the file
Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 8 guests