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

Leviath.NL
Traffic Manager
Traffic Manager
Posts: 152
Joined: 28 Jan 2006 15:00

Re: PNGCodec

Post by Leviath.NL »

Or try using the path from pngcodec to the png file
User avatar
Wacki
Traffic Manager
Traffic Manager
Posts: 137
Joined: 28 Feb 2007 09:02
Location: Czech Republic
Contact:

Re: PNGCodec

Post by Wacki »

But I have pngcodec and .png file in the same folder!!!!!! :?
I really don´t know! :(
Sorry for my very bad English!!! :(
I am 3dsmax artist.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: PNGCodec

Post by DaleStan »

Wacki wrote:Image
But I have pngcodec and .png file in the same folder!!!!!! :?
I really don´t know! :(
That's as may be, but the file you specified there is relative to the path in the command prompt, not any other path, so it's D:\4622.png. If that's not where the file is, then you need to specify that the file is somewhere else.
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
Wacki
Traffic Manager
Traffic Manager
Posts: 137
Joined: 28 Feb 2007 09:02
Location: Czech Republic
Contact:

Re: PNGCodec

Post by Wacki »

Thank you, I think that it work correctly now! :D
Sorry for my very bad English!!! :(
I am 3dsmax artist.
MvGulik
Engineer
Engineer
Posts: 5
Joined: 25 Jan 2008 14:34
Location: NL
Contact:

Re: PNGCodec

Post by MvGulik »

Hi

Just sharing something seemingly minor about Pngcodec.
(using: Pngcodec, r10512, win32. On XP/sp2)

Short version:
Its possible to save 'y_offs' or 'x_offs' data with Pngcodec that contain [CR] characters.

Pngcodec will output the [CR] as is.
(Exiftool shows the [CR] as a dot.)

OpenTTD seems not to be effected by this. (when the [CR] character is the last character)

Some quick dos(win) bat code's. (no spaces in path or file names)
1) generate png data list.

Code: Select all

dir /s /b *.png > out1.log
echo.>out2.log
FOR /F %%Q IN (out1.log) DO pngcodec.exe l %%Q >> out2.log
2) for after editing png data list. (remove all but 'y_offs' or 'x_offs' settings/keys.)

Code: Select all

FOR /F "tokens=1-3" %%Q IN (new.log) DO pngcodec.exe r %%Q %%R %%S
Cheers.
M.v.Gulik.

edit: code 2 correction.
User avatar
bazil14
Engineer
Engineer
Posts: 44
Joined: 22 Sep 2007 12:45

Re: PNGCodec

Post by bazil14 »

hello, i was trying to use pngcodec, but everytime i run the program it closes itsself within a second :( i see some text (about pngprops) but it goes within the second) does have anyidea what im doing wrong, if so can you tell me and i will be very happy
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: PNGCodec

Post by Rubidium »

You're not running it from the console.
User avatar
bazil14
Engineer
Engineer
Posts: 44
Joined: 22 Sep 2007 12:45

Re: PNGCodec

Post by bazil14 »

the console ?, sorry im not very good at computer sometimes
User avatar
Ben_Robbins_
Tycoon
Tycoon
Posts: 1234
Joined: 20 Nov 2005 01:56
Location: Abu Dhabi, UAE

Re: PNGCodec

Post by Ben_Robbins_ »

It means that you need to run it from something like command prompt. If I were you I'd do what I do and make a .bat file and click that. I find that's quicker and easier. There are some .bat's in the .blend thread in some of my recent posts. To edit them change the name to 'something.txt', instead of 'something.bat' then open and edit the necessary bit's, rename back to .bat and run. Make sure the pngcodec.exe is in that same folder.
Ben
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: PNGCodec

Post by GeekToo »

You can find an example here:
http://www.tt-forums.net/viewtopic.php?p=658581#p658581

Look in the other.rar file.

Another hint: if you're pngcodecing longer trains, try to use the Ctrl-B key in the game, it will show the bounding boxes. That can help you to avoid graphical glitches.
S-ed
Engineer
Engineer
Posts: 1
Joined: 16 Mar 2009 17:51

Re: PNGCodec

Post by S-ed »

As I know 32bpp means 24bit color(8*RGB) + 8bit Alpha, so...

Does PNGCodec (and Open TTD) supports alpha blending? :?:

p.s.: Sorry but cant find answer in forum...
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1790
Joined: 30 Mar 2005 09:43

Re: PNGCodec

Post by peter1138 »

Yes, OpenTTD supports alpha transparency.
He's like, some kind of OpenTTD developer.
Eudelis
Engineer
Engineer
Posts: 2
Joined: 13 Oct 2009 15:58

Re: PNGCodec

Post by Eudelis »

I have an image
1017_z0.png
1017_z0.png (58.82 KiB) Viewed 6172 times
What options should I specify in pngcodec, so it is normally displayed in Openttd

English do not know, used an interpreter -_-
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: PNGCodec

Post by DaleStan »

The ones that cause it to be displayed normally in OpenTTD.

It's a trial-and-error process.
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
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: PNGCodec

Post by Wasila »

Are there any graphics that need to be adjusted in PNGCodec? I want to test it out and see how it goes.
maquinista
Tycoon
Tycoon
Posts: 1829
Joined: 10 Jul 2006 00:43
Location: Spain

Re: PNGCodec

Post by maquinista »

Wasila wrote:Are there any graphics that need to be adjusted in PNGCodec? I want to test it out and see how it goes.
Most of graphics ready has been coded. Most of the work needed is new sprites, for example, the road stops or some factories.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: PNGCodec

Post by Zephyris »

Would it be possible to add a command to view the current x_offs and y_offs of a file? Or is there some other way of doing this? It would be useful for copying good offsets from existing graphics...
maquinista
Tycoon
Tycoon
Posts: 1829
Joined: 10 Jul 2006 00:43
Location: Spain

Re: PNGCodec

Post by maquinista »

Zephyris wrote:Would it be possible to add a command to view the current x_offs and y_offs of a file? Or is there some other way of doing this? It would be useful for copying good offsets from existing graphics...

Code: Select all

Usage:
 to list properties:      pngcodec l <filename>
 to clear all properties: pngcodec c <filename>
 to replace properties:   pngcodec r <filename> [key=value] [key=value] [...]
 to add properties:       pngcodec a <filename> [key=value] [key=value] [...]
Use the first comand.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: PNGCodec

Post by Zephyris »

Greatest apologies for failing in such an epic way! :oops:
User avatar
coyoteelabs
Engineer
Engineer
Posts: 27
Joined: 07 Aug 2006 09:52
Location: Romania

Re: PNGCodec

Post by coyoteelabs »

Looks like a lot of people don't look in the NewGRF Technical Discussions section.

A GUI based alternative for PNG codec I wrote has been available since May 2009 for Windows (should work with Wine).

I just made a big improvement to the program and some of the features it has:
* visual placement of png sprites and offset editing
* can display any number of sprites at the same time (useful for buildings split across several tiles)
* built-in CROP tool to remove empty space from sprites (with auto-detection for maximum safe cutting)
* drag & drop

and more.

Enjoy

Visual PNG codec thread.

Visual PNG codec - Win32 GUI based alternative for PNG codec
PNG crop - Win32 Console based tool for PNG cropping
PNG Resize - Win32 Console based tool for PNG Resizing (z0 -> z1 / z2)
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 9 guests