Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Jun 19, 2013 3:05 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sat Mar 14, 2009 12:22 am 
Offline
Engineer
Engineer

Joined: Fri Mar 13, 2009 11:45 pm
Posts: 12
Greetings,

I optimized (losslessy) and attached to this post PNG files from OpenTTD 0.7.0 beta 2
I used script and programs from Hydrogenaudio thread with "--insane" switch. EDIT: currently, I used only PNGOUT application. Script has flaws.

Old size: 116797
New size: 64609

For 10000 downloads it saves ~0.5Gb of traffic ;)

See also: Smaller ZIP/7z package (by from ~3.5% to ~28% for OpenTTD)

EDIT: Please redownload, there is a fixed version of "openttd.16.png" plus all files are even smaller.

Peter


Attachments:
File comment: All files reoptimized !
OpenTTD-PNGs-FIXED.zip [63.59 KiB]
Downloaded 55 times


Last edited by CobraPL on Mon Mar 16, 2009 12:58 am, edited 8 times in total.
Top
 Profile  
 
PostPosted: Sat Mar 14, 2009 1:07 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3712
Your openttd.16.png is NOT the same as the openttd.16.png shipped with OpenTTD so somewhere in the conversion colours have been changed. Seems like the alpha blur at the sides of the logo has been lost.

Just compare them side by side in e.g. The GIMP.


Top
 Profile  
 
PostPosted: Sat Mar 14, 2009 1:03 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 13, 2009 11:45 pm
Posts: 12
Well, source files were the original ones. Palette is probably changed, so only 168 of used colors are in palette (not used ones are removed from palette). I double checked problem you described. Both with PAINT.NET and Gimp - pictures are identical, including alfa.

But... Just after installing GIMP I made stupid mistake and I dragged both files, one by one, into the same window which caused effect, that second file has darker alfa on corners. I simply added second file as new layer for first one.

Just launch GIMP, select FILE/NEW two times, so you will have TWO empty windows. Then drag and drop first file to one window, second to another, use 2000% magnify on both. You will see that these files are identical.


Top
 Profile  
 
PostPosted: Sat Mar 14, 2009 7:31 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Tue Oct 03, 2006 6:26 pm
Posts: 351
Location: Prague, Czech Republic
Sorry, it really looks your image is missing the alpha channel


Attachments:
notsame.png [35 KiB]
Downloaded 214 times

_________________
Image
Top
 Profile  
 
PostPosted: Sat Mar 14, 2009 9:32 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 13, 2009 11:45 pm
Posts: 12
SmatZ wrote:
Sorry, it really looks your image is missing the alpha channel


STRANGE! I use GIMP 2.6.4 (see attachment). Not only both files are identical, but also are RGB, 2 layers. In your gimp left one is "indexed, 1 layer" and right one is "RGB, 1 layer". But we are talking about same files... Which version do you have? Did you tried another program ?
I think that we should see these icons in real life. I can't find, where these icons are used in the game. Anyway, I added proof that alfa works.

Optimized:
ImageImageImageImageImage

Original:
ImageImageImageImageImage


Attachments:
File comment: Huh?
TheSame.PNG [86.52 KiB]
Downloaded 125 times
Top
 Profile  
 
PostPosted: Sat Mar 14, 2009 11:05 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Tue Oct 03, 2006 6:26 pm
Posts: 351
Location: Prague, Czech Republic
It looks it has the alpha channel when opened in Firefox... I am not really a graphic, so I will leave that for someone else to explain :)

_________________
Image


Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 1:39 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
8-bit indexed destroys the alpha channel, essentially by definition.

_________________
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


Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 7:56 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Mar 30, 2005 9:43 am
Posts: 1465
DaleStan wrote:
8-bit indexed destroys the alpha channel, essentially by definition.

Not when you have an RGBA palette table.

Wikipedia wrote:
For paletted images, alpha values can be added to palette entries. The number of such values stored may be less than the total number of palette entries, in which case the remaining entries are considered fully opaque.

_________________
He's like, some kind of OpenTTD developer.


Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 12:40 pm 
Offline
President
President
User avatar

Joined: Sun Jun 03, 2007 10:22 pm
Posts: 949
CobraPL wrote:
Not only both files are identical, but also are RGB, 2 layers.


Incorrect, your .16.png file, unzipped from your first post is 8 bit indexed, the original (in my media folder) is rgba.

CobraPL wrote:
In your gimp left one is "indexed, 1 layer" and right one is "RGB, 1 layer". But we are talking about same files... Which version do you have? Did you tried another program ?
I added proof that alfa works.


Incorrect again, you proved that transparency worked, by specifying in the palette that the first colour index should not be drawn (i.e. transparent).
But as DaleStan stated, you cannot specify the alfa value, i.e. make something 50% transparent. And exactly that is used in the originals to do some anti-aliasing on the edges. Because you can only specify 0% or 100% transparency, the edges will look jaggy.


Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 10:19 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 13, 2009 11:45 pm
Posts: 12
GeekToo wrote:
CobraPL wrote:
Not only both files are identical, but also are RGB, 2 layers.


Incorrect, your .16.png file, unzipped from your first post is 8 bit indexed, the original (in my media folder) is rgba.


My GIMP shows RGB, 2 layers, you have it on the screenshot.

GeekToo wrote:
CobraPL wrote:
In your gimp left one is "indexed, 1 layer" and right one is "RGB, 1 layer". But we are talking about same files... Which version do you have? Did you tried another program ?
I added proof that alfa works.


Incorrect again, you proved that transparency worked, by specifying in the palette that the first colour index should not be drawn (i.e. transparent).
But as DaleStan stated, you cannot specify the alfa value, i.e. make something 50% transparent. And exactly that is used in the originals to do some anti-aliasing on the edges. Because you can only specify 0% or 100% transparency, the edges will look jaggy.


If you have right, why both images look identical (which I shown already), including transparency - in this thread, in my GIMP, in my Paint.net ? I dont't know technically what was changed, I know, that files are smaller and look identical. No anti-aliasing is lost, which you can see in this thread - maybe it is lost in old GIMP version. Of course, DEVs should have backup of original files, but I think, that distributable version should be the optimized one.

Also i checked transparency - it is >0 and <100

By the way, I have two questions:
1) Where are these PNGs used? I know, that these files are stored in \media\ but where in game?
2) What will go wrong if optimized version will be in package? Who will not see anti-aliasing or alpha channel and where ? I mean in real life. So far I know about (outdated?) version of GIMP - my version shows everything ok.

Hmm...


Attachments:
File comment: 50% transparency ?
50%.png [129.22 KiB]
Downloaded 93 times
Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 10:58 pm 
Offline
President
President
User avatar

Joined: Sun Jun 03, 2007 10:22 pm
Posts: 949
Your 256.png seems to be ok, but I was asking to look at the openttd.16.png file (and also Rubidium did).

That one is not ok. Both Photoshop and Irfanview see it as an 8bpp indexed file. So load your zip file from the first post, unpack it, and try again.


Top
 Profile  
 
PostPosted: Sun Mar 15, 2009 11:31 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 13, 2009 11:45 pm
Posts: 12
GeekToo wrote:
Your 256.png seems to be ok, but I was asking to look at the openttd.16.png file (and also Rubidium did).

That one is not ok. Both Photoshop and Irfanview see it as an 8bpp indexed file. So load your zip file from the first post, unpack it, and try again.


Please, try fixed version from the first post. Opimizing script has a flaw(s) - sometimes files are bigger after optimization. Espiecially small ones.

Please check current version of PNGs. If everything is OK, please consider adding these files to 0.7.0.


Top
 Profile  
 
PostPosted: Mon Mar 16, 2009 8:11 pm 
Offline
President
President
User avatar

Joined: Sun Jun 03, 2007 10:22 pm
Posts: 949
Looks ok to me now :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.