FrG Image File Format (1): Introduction

Source: Internet
Author: User
FrG Image File Format (1): IntroductionAuthor: HouSisong@GMail.com 3.03.06.11


Are you always waiting to watch the loading progress bar for a game you like (or scene switching!
As a programmer, do you have no way to do this:
In BMP format, the format is simple to decode quickly (equivalent to memory copy), but it takes up a lot of disk space, and the disk speed and memory speed are almost two orders of magnitude!
JPG format. The file occupies a small amount of space, but the decoding is complicated and slow. The alpha channel is not supported. To optimize the decoding speed, the special decoder version is developed and optimized for special CPU instruction sets, or is there a hardware decoder in a running environment that is specially developed with GPU decoding?
PNG format, medium file space, lossless compression, alpha channel supported; but the decoding speed is very slow;

Is there an image file format designed based on both the file size and decoding speed?
Some resource image formats for similar purposes have been produced in the 3D game field, such as s3tc (dxtc), fxt1, and ASTC (of course, saving video memory may be a more important design goal)
They are generally fixed in compression ratio, simple in image format, and fast in codec (you do not even need to decompress the package during application). The disadvantage is that the compression ratio is moderate, the compression quality cannot be controlled, and the quality loss of many types of images after compression is too high, rarely used in exquisite images and 2D applications;

Can we design an image format that is controllable, occupies a small amount of files, and can be decoded quickly?

This is the design purpose of FRG ("Fast Read graphics" or "fast resource graphics; frG is not designed to add a common image exchange format (webp of Google is hard to do now );
It only meets the requirements of its design goals. It is not intended for end users. It should only exist in the resources of the release package;

FrG is an image file format optimized from disk loading and decoding to display time required; (Performance Testing: http://blog.csdn.net/housisong/article/details/9071113 );

FrG supports lossless compression, quality loss compression, and 32 bitargb color (current alpha channel lossless compression). FRG application scenarios: reduce the size of resource image files, it is also required to be able to quickly decode and display. Encoding files are generally released with applications, but do not care about the time and memory space occupied during encoding;


Try FRG to stop users from waiting for your games and applications!


 


Image File size (lossless ):
BMP (argb32bit): 481,654 bytes
PNG: 121,363 bytes
JPG (100 quality): 94,696 bytes (no alpha)
Jpg2000 (100 quality): 117,796 bytes
Tiff (LZW): 211,980 bytes
FRG (100 Quality) (0 size): 182,865 bytes



FRG (90 Quality) (0 size): 102,541 bytes FRG (80 Quality) (0
Size): 66,659 bytes


FRG (75 Quality) (0 size): 40,982 bytes

(More compression quality display: http://blog.csdn.net/housisong/article/details/9068535)



Demo program and source code:

Demo program:
I have provided command line programs in windows, MacOSX, and Linux systems. (I have no experience in publishing a program in MacOSX or Linux. I have tried it on this machine, but I don't know if it can be executed on another computer;) The program provides the mutual conversion function between PNG and FRG (Be sure not to overwrite your PNG Image ).
Demo download: https://github.com/sisong/png2frg_app/archive/master.zip

FrG source code:
FrG uses a very free MIT open source authorization protocol;
Project address: https://github.com/sisong/libfrg
Welcome to use and contribute your code to this project!

(Encoding technology introduction:
Http://blog.csdn.net/housisong/article/details/9078301)


(Some interesting feature support is also under further consideration: for example, a more friendly memory or video compression format \ better encoding quality and size control capability \ more direct support for output color formats? \ New end-user encoder \ support higher quality parameters for areas of interest)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.