Page 1 of 2

@ Norb - Maps JPG - PNG

Posted: Fri Jan 24, 2014 9:23 am
by Davinci
Hey, did you know that the four RGB.JPG files can be changed to RGB.png files and the game still works, and look the same but reduces the file maps file size.

I also had to edit the terrain.lvl file with a Hex-Editor to change the files to png .

I can't see any added FPS by doing this, but the file size went from 43,410Kb too 20,545Kb.

Interesting that the game still looks the same by changing the file types.

davinci

Re: @ Norb - Maps JPG - PNG

Posted: Fri Jan 24, 2014 6:02 pm
by Little Powell
Hi Davinci. I'm wondering how can you have a PNG at smaller file size than JPG? PNG's are lossless so usually much larger in size than JPG which we normally keep between 300-700k.

Re: @ Norb - Maps JPG - PNG

Posted: Fri Jan 24, 2014 6:55 pm
by Davinci
Hi Davinci. I'm wondering how can you have a PNG at smaller file size than JPG? PNG's are lossless so usually much larger in size than JPG which we normally keep between 300-700k.
If the four RGB files are saved at a higher quality they can become huge, anywhere from 6,000kb upwards to 9,000kb . This helps to stop them from becoming distorted when opening the PR program multiple times when editing the map.

So, it works for them since the PNG files don't seem to become distorted.

It is not that practical when swapping the other terrain files such as the ground and the leaves, roads, etc.

So, You are correct!

I also changed the eleven terrain files from jpg to png just to see if it would work, and the game still loads and run.

But, the eleven files in jpg-format went from 3.69mb to 13.4mb as png files.

So, that increases the size of the map file.

I just thought that it was interesting that the game would still run and look the same by converting to files to a different format when the game was designed to use a specific format.

davinci

Re: @ Norb - Maps JPG - PNG

Posted: Fri Jan 24, 2014 7:40 pm
by Little Powell
Yeah, we always try to reduce file size any time we can. Smaller size may or may not increase performance, but it will obviously reduce loading times which is always good. I try and keep the RGB jpg's as small as possible without losing definition on the ground textures, typically 300-700 k. However I have found some of the layers need to be higher quality, such as textures that need sharp edges (cobble streets, things like that) or the edges get too dithered.

Re: @ Norb - Maps JPG - PNG

Posted: Fri Jan 24, 2014 10:07 pm
by Garnier
If you don't do any texture blending at all, then saving the rgb files as png might be a lot smaller. Just don't save as jpg and then re-save as png. It also depends on the jpg quality you use. I get away with 32% jpg quality on my maps, but my jpgs are 4096x4096 which I believe is four times the size of stock maps. They're still 800kb each.

Re: @ Norb - Maps JPG - PNG

Posted: Sat Jan 25, 2014 6:59 am
by Davinci
Just don't save as jpg and then re-save as png.
Hey, can you break-this-down and explain it again, I'm not sure what you mean since they are already saved as JPG files.
It also depends on the jpg quality you use. I get away with 32% jpg quality on my maps, but my jpgs are 4096x4096 which I believe is four times the size of stock maps. They're still 800kb each.
Did this size increase give you any better performance, or is it easier making the Bmp file since all of your files are the same size? (i.e..RBG & BMP)

davinci

Re: @ Norb - Maps JPG - PNG

Posted: Sat Jan 25, 2014 12:28 pm
by Garnier
Hey, can you break-this-down and explain it again, I'm not sure what you mean since they are already saved as JPG files.
Oh, I mean if you're making the rgb files yourself, the way PNG compression works it's better if there are only a few different pixel colors. If you have a sharp bitmap and then save as JPG, the compression sort of blends the different colors all over the image, which means they won't compress as well in PNG after that.
But if your rgb files are already JPG there's no way to avoid it.
Did this size increase give you any better performance, or is it easier making the Bmp file since all of your files are the same size? (i.e..RBG & BMP)
I don't know if it affects performance, I just think it looks better in-game. Especially the edges of creeks and roads are 4x sharper.

Re: @ Norb - Maps JPG - PNG

Posted: Sat Jan 25, 2014 1:14 pm
by Davinci
If you have a sharp bitmap and then save as JPG, the compression sort of blends the different colors all over the image, which means they won't compress as well in PNG after that.
But if your rgb files are already JPG there's no way to avoid it.
OK, before I converted the rgb.jpg to rgb.png - I was still saving the backup jpg in the png format.

It took the magic-ward when I was editing the jpg's to show me that they were becoming extremely distorted after opening them multiple times. I would select a color and only a faction of them would be hi-lighted.

So instead of re-opening the rgb.jpg which was distorted - I would open the back-up rgb.png which seemed to hold the colors' better and then just save the rgp.png back to rgb.jpg after editing it.

They worked very well as back-up copies to the jpg files in the game.
I don't know if it affects performance, I just think it looks better in-game. Especially the edges of creeks and roads are 4x sharper.
Interesting, I didn't know that the (rgb) files could be increased!

davinci

Re: @ Norb - Maps JPG - PNG

Posted: Mon Jan 27, 2014 11:56 pm
by pakfront
As Garnier mentioned, JPG is a terrible intermediate format, it's better to save your work as PNG, PSD, or TIF, and only use JPG for the final product. And frankly, even output in JPG for use by a game is a bad idea, as you noticed even that can cause noticeable artifacts. PNG and DDS are more appropriate for textures used by the game.

Re: @ Norb - Maps JPG - PNG

Posted: Tue Jan 28, 2014 12:05 am
by Garnier
Low quality jpg works well for me right now, with the amount of texture blending on my maps PNG would be a lot bigger. Jpg also gives it a little extra blending (because of how jpg works) that doesn't add to the file size. File size is very important for my maps -- I can deploy 20 maps in a 75mb zip every couple weeks so most battles have a unique map. If I can save 10% on map file size, that means two additional maps for people to play on every two weeks. Sometime I'll look at organizing my textures so things that should be sharp like roads and creeks go in one rgb file that is saved as PNG, while the heavily blended grass / dirt textures go in JPGs. This could shave off another 800kb from each map.