ATF Texture Compression Image Quality and File Size Samples
来源:互联网 发布:域名多ip 解析 编辑:程序博客网 时间:2024/06/05 05:14
http://jacksondunstan.com/articles/2013
Adobe’s newly-released ATF tools have introduced an all-new image file format: ATF, the Adobe Texture Format. It’s not every day we get a new image format. After all, PNG was introduced in 1996 and JPEG in 1992. For various reasons I discussed last week, you probably have good reasons to use this new image format. So let’s dive into it a bit and see what kinds of images it produces.
First of all, ATF is actually a bundle of three other texture formats: DXT1 for Windows, Mac OS X, and some Android devices, ETC1 for other Android devices, and PVRTC for iOS. A single ATF file will therefore work everywhere you can run Flash Player or AIR. Further, a fourth image format is used: JPEG-XR. This, in combination with LZMA compression attempt to get the file size down because, as you might imagine when packing three images into one, the file sizes will tend to bloat up.
That’s all well and good, but what image quality do each of these sub-formats produce? Well, let’s look at some examples with an eye to image quality:
Leaf Texture
This texture is a photograph of a leaf that includes alpha. You can find it bundled with the ATF tools.
Original
DXT
ETC
PVRTC
Wizardess
This texture is for a 3D character model based on the Wizardess from Dragoon Quest 3. You can find out more about it and get the texture atsecondtruth.com.
Original
DXT
ETC
PVRTC
VGA Palette
This texture is a grid of the 256 colors of the VGA palette separated by thin black lines. You can find it atcodeproject.com.
Original
DXT
ETC
PVRTC
In my opinion, the quality after compression is quite good in all cases. You can definitely see some artifacts here and there, but in most 3D scenes the dip in quality will likely be acceptable. Of course you will need to decide for yourself given your specific project and specific texture. The above is only a sample.
File Sizes
The ATF tools will let you create an ATF file that holds all three sub-formats above or just one of them. You can also opt for a full set ofmip-map levels or specify just one. These tables show the file sizes with all of the options for the above three textures:
Leaf
Wizardess
VGA Palette
Some of the file sizes here are truly horrific. The VGA Palette image very clearly shows that DXT, ETC,and PVRTC are all geared toward images that are suitable for JPEG compression, not PNG compression. This simple grid of flat colors compresses wonderfully with PNG to a scant 4017 bytes. That’s not even 4KB for a 512×512 image! Then we hand it over to ATF and it’s sub-formats and have it generate mip-maps for good measure. All of a sudden the file rockets up tohalf a megabyte!
The compression we get from these formats is a predictable value not based on the pixels we give it, but simply the image dimensions. Check out the two 512×512 images: Wizardess and VGA Palette. Many of the values are identical between them despite the two images being vastly different in nature.
One upside is that if you can do without mip-maps (e.g. you’re compressing for known display distances or 2D), then you can save about 25% of the file size. If you happen to know the target device your app is going to run on, you can save even more. For example, if you’re only deploying your app to iOS you can only compress for PVRTC. That will typically cut the file size to one third as the other sub-formats are dropped. If you can drop mip-mapsand use only one sub-format, so much the better.
Again, the above images are just a few samples. If you’re going to use ATF, I highly recommend running some tests like I did above to see what ATF compression will do to your image quality and file size. Run thepng2atf
tool like so:
# All sub-formats. All mip-map levels.png2atf -c -i image.png -o image_all.atf # All sub-formats. No mip-map levels.png2atf -c -n 0,0 -i image.png -o image_all_nomip.atf # Only DXT. All mip-map levels.png2atf -c d -i image.png -o image_dxt.atf # Only DXT. No mip-map levels.png2atf -c d -n 0,0 -i image.png -o image_dxt_nomip.atf # Only ETC. All mip-map levels.png2atf -c e -i image.png -o image_etc.atf # Only ETC. No mip-map levels.png2atf -c e -n 0,0 -i image.png -o image_etc_nomip.atf # Only PVRTC. All mip-map levels.png2atf -c p -i image.png -o image_pvrtc.atf # Only PVRTC. No mip-map levels.png2atf -c p -n 0,0 -i image.png -o image_pvrtc_nomip.atf
Then check out the results in the included ATF Viewer application. Having the results right in front of you will help guide your decision to go with compressed textures or not.
Spot an error? Have a question or suggestion? Post a comment!
- ATF Texture Compression Image Quality and File Size Samples
- DXT and ETC Compression Texture
- Image Compression and Coding
- Image and Video Compression Techniques
- The 18 best image file compression tools
- No Reference Image and Video Quality Assessment
- [Unity踩坑系列] Quality Settings为何影响不了Texture Size
- apple icon and image size
- Unity Texture Compression
- Check (Validate) File (Image) Size before upload using JavaScript and jQuery
- Optimization of JPEG (JPG) images: good quality and small size
- gid plus resize image file size
- File size and variable capacity
- ATF(Adobe Texture Format)简介
- JPEG2000 Standard for Image Compression: Concepts, Algorithms and VLSI Architectures
- What is a texture and what is an Image
- image quality analysis
- Enriching image quality.
- ubuntu linux andrid jdk sdk
- 小问题
- USB DeviceToControl()函数
- Linux 系统中配置iSCSI存储
- Python mock测试static 方法——狸猫换太子
- ATF Texture Compression Image Quality and File Size Samples
- NYOJ 289 苹果 (0-1背包)
- 为swing表格添加复选框
- java HashMap类描述的翻译
- 升级linux内核到2.6.24
- VS2010+OpenCV 2.3.0出现“程序无法启动(0xc000000d)”错误的解决方法
- POJ 1741 点分治
- 视频laplace变换
- 在点击按钮时,触发复选框中选中的内容