[Project] PNG Bomber - File byte size optimization (Created by Ace) |
|
01-03-2012, 01:54 AM
(This post was last modified: 05-10-2013 01:05 PM by AceInfinity.)
|
|||
|
|||
|
PNG Bomber - File byte size optimization (Created by Ace)
My new project that i've been working on works on the byte structure of PNG files to optimize the file size by removing arbitrary (junk) data. Still more that can be removed, but I lack the knowledge required to remove photoshop profiles and the junk text chunks, as it seems those can be found with various bytes, I need to find the way they are identified with a signature, and end signature.
More info here: http://tech.reboot.pro/showthread.php?tid=1477 Preview: ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
01-03-2012, 06:16 AM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
I have removed from my application the ability for it to remove the IEND chunk, which is the last 12 bytes of the file for the reason that it is apparently a critical chunk, however it still seems odd to me for the reason that I can't come up with a reason for why it's useful in its existance. I've tried everything...
Everything surprisingly actually works fine with the IEND bytes removed. I tested on this forum uploading the image, and there's no delay in load time, and the image displays perfectly fine, however even on my localhost with apache installed, it seems to load fine. Tested downloading the file on both my localhost, and my website with curl back to my hard disk, and the IEND bytes don't seem to affect any of that either, after the download the IEND still remains out of the picture, but yet my file still acts completely normal... Also tried the right click and save option, but same result. I have yet to see why IEND is an important part of the file, it seems odd to me that I can't replicate any error with it's absence in the byte structure. More investigation is probably needed with this, otherwise the smallest PNG file possible might be even less than 68 bytes... Edit: ![]() ![]() I know it marks the end of the PNG stream of data and it always appears last as the last 12 bytes in the file, but there's no identification for why it's such an important/critical chunk from what i've read up on PNG files up 'till now. Very strange that they don't document any of that. I have my application check for these bytes at the beginning of the file because it's the first stream of bytes that define the PNG file format, then you have the IHDR and IDAT along with all the other arbitrary junk data in there, and the ICC profiles I still have to learn about, but that last part (IEND) based on my tests, doesn't do anything as far as my eyes have seen :huh: The CRC in my files without it seems to be stable. Each bit of the IEND chunk points towards the fact that the Ancillary bit is 0, along with the Private, Reserved, and Safe-to-copy bits as well, being that they are all uppercase. ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
01-03-2012, 07:29 AM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
Pretty amazing work there Ace!
Despite all my rage I am still just a rat in a cage... {SP} |
|||
|
01-03-2012, 07:43 AM
(This post was last modified: 01-03-2012 07:58 AM by AceInfinity.)
|
|||
|
|||
RE: PNG Bomber - File byte size optimization (Created by Ace)
(01-03-2012 07:29 AM)_HAWK_ Wrote: Pretty amazing work there Ace! Thanks :) what this project needs is now a method to remove ICC profiles for things like photoshop data profiles that are left behind if the image was created in photoshop, and text chunks of bytes. If I can remove the ICC profiles that could potentially double the reduction of filesizes, because ICC profile byte chunks are relatively large in a PNG file. For some odd reason the photoshop profile which gets added thinks it needs to add lots of bytes to your file, when the whole idea of PNG was to keep the file small. So it is removable, they avoided having that data written to IHDR, and just created it's own sector for that information. I'm still undecisive on the whole IEND confliction though. It makes no sense to me as to why it's required, as my PNG files act completely the same with or without it. It would make a 12 byte difference but, that's what file optimization is isn't it? File reduction to it's best. Edit: I finally see the importance of IEND now! And it is for data streaming... I will no longer look into removing this sector from the PNG file itself for optimization. ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
01-03-2012, 08:05 AM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
Good tool, good video. :)
Glad to see that you are learning your way to manipulate binary structures. Want to help TLF? Place tech.reboot.pro on your signature around the web. Let's help TLF grow! :) |
|||
|
01-03-2012, 08:15 AM
(This post was last modified: 01-03-2012 08:18 AM by AceInfinity.)
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
At first IEND was confusing me, as it didn't seem to have any value, being that I was able to view the file with windows live gallery, and photoshop (even edit with photoshop), and it would read and preview my file on a webserver (localhost and tech.reboot.pro). It wasn't until I tried an uploading service that I identified it's importance, so that was a bit of a struggle at first, but I overcame that. The rest was fairly straightforward after some extensive research on the binary structure of PNG's.
I still have possibility to remove a few more data chunks though, and learn how to reduce or compress IDAT chunks that are only allowed to be of a certain size until a new one is created until the data of the entire PNG file is written. And I may provide another application as an option to remove transparency alone all by itself. It's only 1 byte difference so I don't see anyone caring about removing the transparency chunk for filesize as much as they want to just remove the transparency itself for some reason. Everything done so far, results in a lesser filesize, but as a lossless output. Text and ICC profiles as far as I know are the one's that come next for this application's improvement... PNG seems to be a very minimal format to begin with though, so not much file reduction can take place even if you were to remove all the possible known arbitrary data chunks. ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
05-10-2013, 11:17 AM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
video is dead :(
seems of the image it looks good :) |
|||
|
05-10-2013, 01:05 PM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
This is a very old project. And you know that image has nothing to do with my program? That is curl.
![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
|
05-10-2013, 03:07 PM
|
|||
|
|||
|
RE: PNG Bomber - File byte size optimization (Created by Ace)
hi ace,
aww sorry :( my mistake i guess. |
|||
|
05-10-2013, 03:18 PM
|
|||
|
|||
RE: PNG Bomber - File byte size optimization (Created by Ace)
(05-10-2013 03:07 PM)1912Dummy Wrote: hi ace, I was using curl if I can remember correctly to see if I could download the image from somewhere off the net, after uploading one of my modified images, along with seeing if it would display correctly. That's not my program though.. ![]() Microsoft MVP .NET Programming - (2012 - Present) ®Crestron DMC-T Certified Automation Programmer Development Site: aceinfinity.net |
|||
Possibly Related Threads... |
| Thread: | Author | Replies: | Views: | Last Post | |
How do you display the file name and path in Me.Text ? |
william7 | 13 | 441 |
05-10-2013 11:15 PM Last Post: AceInfinity |
|
| File writer | cedonni | 4 | 195 |
03-25-2013 04:42 PM Last Post: cedonni |
|
Save / Load Config File |
simx | 8 | 316 |
02-09-2013 10:16 PM Last Post: AceInfinity |
|
[Help] Parsing an XML file into a C# object |
kevorz | 35 | 1,455 |
01-11-2013 02:51 PM Last Post: AceInfinity |
|
| Not able to write to text file | Crystalii | 4 | 424 |
11-22-2012 02:02 AM Last Post: csin |
|
| Users browsing this thread |
| 1 Guest(s) |

PNG Bomber - File byte size optimization (Created by Ace)








