Browse files

Initial Commit

  • Loading branch information...
0 parents commit a9b7b2215d769b85e89498876e48916cb420139e @yugeninteractive committed Jan 5, 2013
Showing with 12,683 additions and 0 deletions.
  1. BIN .DS_Store
  2. +11 −0 .project
  3. +59 −0 README.txt
  4. +9 −0 build/build.properties
  5. +390 −0 build/build.xml
  6. +73 −0 build/createproject.sh
  7. +52 −0 build/default.properties
  8. BIN build/tools/htmlcompressor-0.9.3.jar
  9. BIN build/tools/jpegtran.exe
  10. +21 −0 build/tools/optipng-0.6.4-exe/LICENSE.txt
  11. +2 −0 build/tools/optipng-0.6.4-exe/OptiPNG.url
  12. +32 −0 build/tools/optipng-0.6.4-exe/doc/caveat.txt
  13. +318 −0 build/tools/optipng-0.6.4-exe/doc/history.txt
  14. +677 −0 build/tools/optipng-0.6.4-exe/doc/manual.html
  15. BIN build/tools/optipng-0.6.4-exe/doc/manual.pdf
  16. +280 −0 build/tools/optipng-0.6.4-exe/doc/manual.txt
  17. +634 −0 build/tools/optipng-0.6.4-exe/doc/png_optimization_guide.html
  18. +325 −0 build/tools/optipng-0.6.4-exe/doc/thanks.html
  19. +57 −0 build/tools/optipng-0.6.4-exe/doc/todo.txt
  20. BIN build/tools/optipng-0.6.4-exe/optipng.exe
  21. BIN build/tools/yuicompressor-2.4.2.jar
  22. +10 −0 deploy/css/yugen-logo-hideOnLoad.css
  23. +74 −0 deploy/css/yugen-logo.css
  24. BIN deploy/images/logos/1.png
  25. BIN deploy/images/logos/10.png
  26. BIN deploy/images/logos/11.png
  27. BIN deploy/images/logos/12.png
  28. BIN deploy/images/logos/13.png
  29. BIN deploy/images/logos/14.png
  30. BIN deploy/images/logos/2.png
  31. BIN deploy/images/logos/3.png
  32. BIN deploy/images/logos/4.png
  33. BIN deploy/images/logos/5.png
  34. BIN deploy/images/logos/6.png
  35. BIN deploy/images/logos/7.png
  36. BIN deploy/images/logos/8.png
  37. BIN deploy/images/logos/9.png
  38. BIN deploy/images/yugen-word.png
  39. +2 −0 deploy/index.html
  40. +99 −0 deploy/js/input/yugenlogo.input.move.js
  41. +45 −0 deploy/js/input/yugenlogo.input.orientation.js
  42. +105 −0 deploy/js/input/yugenlogo.input.press.js
  43. +167 −0 deploy/js/libs/jquery-1.4.4.min.js
  44. +5 −0 deploy/js/scripts.min.js
  45. +5 −0 deploy/js/yugenlogo.min.js
  46. +1 −0 deploy/js/yugenlogo.util.min.js
  47. +10 −0 source/css/yugen-logo-hideOnLoad.css
  48. +74 −0 source/css/yugen-logo.css
  49. BIN source/images/logos/1.png
  50. BIN source/images/logos/10.png
  51. BIN source/images/logos/11.png
  52. BIN source/images/logos/12.png
  53. BIN source/images/logos/13.png
  54. BIN source/images/logos/14.png
  55. BIN source/images/logos/2.png
  56. BIN source/images/logos/3.png
  57. BIN source/images/logos/4.png
  58. BIN source/images/logos/5.png
  59. BIN source/images/logos/6.png
  60. BIN source/images/logos/7.png
  61. BIN source/images/logos/8.png
  62. BIN source/images/logos/9.png
  63. BIN source/images/yugen-word.png
  64. +107 −0 source/index.html
  65. +99 −0 source/js/input/yugenlogo.input.move.js
  66. +45 −0 source/js/input/yugenlogo.input.orientation.js
  67. +105 −0 source/js/input/yugenlogo.input.press.js
  68. +7,179 −0 source/js/libs/jquery-1.4.4.js
  69. +167 −0 source/js/libs/jquery-1.4.4.min.js
  70. +1,258 −0 source/js/yugenlogo.js
  71. +186 −0 source/js/yugenlogo.util.js
BIN .DS_Store
Binary file not shown.
11 .project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Meru_Logo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
59 README.txt
@@ -0,0 +1,59 @@
+0.1 Initial release
+
+
+Example
+-------
+http://yugen.ca/lab/yugenlogo/source/index.html
+
+
+Authors
+-------
+Hakim El Hattab - Development - http://hakim.se
+Garus Booth - Founder / Art Direction / Design - http://bythebooth.com
+Ram Puvanesasingham - Founder - http://yugen.ca
+Kuhan Puvanesasingham - Founder - http://yugen.ca
+
+
+
+
+Yugen Logo Documentation
+========================
+
+This document outlines the functionality built into the Yugen logo animation project and aims to explain the source architecture on a high level.
+
+
+Fallback
+--------
+The primary logo animation is rendered on the HTML5 canvas element but there are also two levels of degraded experiences depending on what level of support is detected. Layer by layer:
+
+
+1. If JavaScript is not available a static image is shown.
+
+2. If JavaScript is available BUT support for canvas is not detected, a rotation of still images is shown. The image changes whenever the mouseover event is dispatched by the container DOM element. The list of images to rotate through can be configured via the initialization object on the YugenLogo class (more on that later).
+
+3. If Javascript is available AND canvas support is detected, we run the intended canvas animation. Bells. Whistles. The works!
+
+
+JavaScript Structure
+--------------------
+The core of the logo animation logic and display is in the source/js/yugenlogo.js file. Any type of interaction input that affects the logo is stored in a separate plug-in JavaScript file. This decoupling enables a flexible architecture that simplifies the process of adding new, or removing old, types of input. Input files are stored in the source/js/input/ folder.
+
+
+Configuration
+-------------
+The index.html file delivered with this project contains some debug elements which help test the configuration values of the logo.
+
+The logo has an extensive range of options available to configure the properties of shapes, fallback images, framerate, colors and much more. The default options with inline documentation can be found in source/js/yugenlogo.js, note that not all of these are exposed in the debug panel. Options can be overridden when calling the YugenLogo.initialize method, see the bottom of index.html for an example of this.
+
+
+Build script
+------------
+There are Ant build scripts available in the build/ folder to help simplify the deployment process. This script takes everything in the source/ folder, minifies it, and moves it to the deploy folder.
+
+
+License
+-------
+MIT licensed
+
+Copyright (C) 2013
+Yugen Inc. http://yugen.ca
9 build/build.properties
@@ -0,0 +1,9 @@
+# build.properties file defines overrides for default.properties
+# Explaination: This file should be created by each user as and when he or she needs to override particular values.
+# Consequently, it should not be placed under version control.
+
+dir.build = build
+dir.publish = deploy
+dir.source = source
+dir.css = css
+dir.js = js
390 build/build.xml
@@ -0,0 +1,390 @@
+<?xml version="1.0"?>
+<project name="Meru Logo" default="build" basedir="../"> <!-- one back since we're in build/ -->
+ <!-- load property files -->
+
+ <property file="build/build.properties"/>
+ <property file="build/default.properties"/>
+
+ <!-- there are three different options for html optimization:
+ buildkit : all html whitespace retained. inline script/style minified
+ htmlclean (default) : minor html optimizations (extra quotes removed). inline script/style minified
+ htmlcompress : html minification
+ -->
+
+ <target name="basics" depends="clean,copy,usemin,js.all,css,html" description="Concats files, runs YUI Compressor on them and makes magic happen."/>
+
+ <target name="text" depends="basics,htmlclean" description="Concats files, runs YUI Compressor on them and makes magic happen."/>
+ <target name="buildkit" depends="basics,htmlbuildkit" description="Concats files, runs YUI Compressor, optimizes images. There is much rejoicing."/>
+ <target name="build" depends="basics,htmlclean" description="Concats files, runs YUI Compressor, optimizes images. There is much rejoicing."/>
+ <target name="minify" depends="basics,htmlcompress" description="Concats files, runs YUI Compressor, optimizes images. There is much rejoicing."/>
+
+ <!--
+ Wipe the old
+
+ -->
+ <target name="clean">
+ <echo message="Cleaning up previous build directory..."/>
+ <delete dir="./${dir.publish}/"/>
+ </target>
+
+
+
+
+ <!--
+ Copy in the new stuff
+
+ -->
+
+ <target name="copy" depends="clean">
+ <echo message="Copying over new files..."/>
+ <copy todir="./${dir.publish}">
+ <fileset dir="./${dir.source}">
+ <exclude name=".gitignore"/>
+ <exclude name=".project"/>
+ <exclude name=".settings"/>
+ <exclude name="README.markdown"/>
+ <exclude name="**/.git/**"/>
+ <exclude name="**/.svn/**"/>
+ <exclude name=".gitignore"/>
+ <exclude name="*.conf*"/>
+ <exclude name="mime.types"/>
+ <exclude name="**/${dir.build}/**"/>
+ <exclude name="**/${dir.test}/**"/>
+ <exclude name="**/${dir.demo}/**"/>
+ <exclude name="**/${dir.js}/profiling/**"/>
+
+ <!-- configurable excludes -->
+ <exclude name="**/${file.exclude}/**"/>
+ </fileset>
+ </copy>
+ </target>
+
+
+
+
+ <!-- Optimize javascript files
+ -->
+ <target name="js.all" depends="js.remove.console, js.all.min, js.main.concat, js.concat.scripts, js.minifyonly.min, js.delete"></target>
+
+
+ <!--
+ JS: Concat primary scripts
+
+ -->
+ <target name="js.main.concat" depends="js.all.min">
+ <echo message="Concatenating JS scripts"/>
+ <concat destfile="./${dir.publish}/${dir.js}/scripts.js">
+ <fileset dir="./${dir.publish}/">
+ <include name="**/${dir.js.main}/*.min.js"/>
+ <exclude name="**/${dir.js.libs}/*.js"/>
+ </fileset>
+ </concat>
+ </target>
+
+
+
+ <!--
+ JS: Concat library scripts
+
+
+ -->
+ <!-- Comment out console.log commands from main scripts -->
+ <target name="js.remove.console" description="Comment out console.log lines">
+ <echo>Commenting out console.log lines</echo>
+
+ <replaceregexp match="(console.log\(.*\))" replace="/\*\1\*/" flags="g" >
+ <fileset dir="./${dir.publish}/${dir.js}/">
+ <include name="**/*.js"/>
+ <exclude name="**/*.min.js"/>
+ </fileset>
+ </replaceregexp>
+
+ </target>
+
+
+
+ <!--
+ JS: Minify primary scripts and libraries
+
+ -->
+ <target name="js.all.min" depends="copy">
+ <echo message="Minifying concatenated script- and library-file"/>
+ <apply executable="java" parallel="false">
+ <fileset dir="./${dir.publish}/${dir.js}">
+ <include name="*.js"/>
+ <exclude name="*.min.js"/>
+ <exclude name="**/${dir.js.libs}/*.js"/>
+ </fileset>
+ <arg line="-jar"/>
+ <arg path="./${dir.tools}/${tool.yuicompressor}"/>
+ <srcfile/>
+ <arg line="--line-break"/>
+ <arg line="4000"/>
+ <arg line="-o"/>
+ <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js}/*.min.js"/>
+ <targetfile/>
+ </apply>
+ </target>
+
+
+ <!--
+ JS: Minify helper files.
+ these files do not get concat'd with anyone else.
+ they will get a build number in their filename though
+
+ -->
+ <target name="js.minifyonly.min">
+ <echo message="Minifying helper JS files"/>
+
+ <apply executable="java" parallel="false">
+ <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
+ <arg line="-jar"/>
+ <arg path="./${dir.tools}/${tool.yuicompressor}"/>
+ <srcfile/>
+ <arg line="-o"/>
+ <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js.libs}/*.min.js"/>
+ <targetfile/>
+ </apply>
+ </target>
+
+
+ <!--
+ JS: Concat mylibs- and scripts- into a normal and a debug file.
+ Then rename them to s/-all//
+
+ -->
+ <target name="js.concat.scripts" if="build.concat.scripts">
+
+
+ <echo message="Concatenating library file with main script file"/>
+ <concat destfile="./${dir.publish}/${dir.js}/scripts.min.js">
+ <fileset dir="./${dir.publish}/${dir.js}/">
+ <include name="libs.js"/>
+ <include name="scripts.js"/>
+ </fileset>
+ </concat>
+
+ <echo message="Concatenating library file with main debug script file"/>
+ <concat destfile="./${dir.publish}/${dir.js}/scripts-debug.min.js">
+ <fileset dir="./${dir.publish}/${dir.js}/">
+ <include name="libs.js"/>
+ <include name="scripts-debug.js"/>
+ </fileset>
+ </concat>
+
+ <echo>About to rename scripts-all to scripts</echo>
+ <!--
+ <move file="./${dir.publish}/${dir.js}/scripts-all.min.js" tofile="./${dir.publish}/${dir.js}/scripts.min.js"/>
+ <move file="./${dir.publish}/${dir.js}/scripts-all-debug.min.js" tofile="./${dir.publish}/${dir.js}/scripts-debug.min.js"/>
+ -->
+ </target>
+
+
+ <!--
+ JS: Delete unoptimized files (If set)
+
+ -->
+ <target name="js.delete" if="build.delete.unoptimized" depends="js.if.concat.scripts">
+ <echo message="Deleting unoptimized files"/>
+
+
+ <delete file="./${dir.publish}/${dir.js}/scripts.js"/>
+
+ <delete file="./${dir.publish}/${dir.js}/scripts-debug.js"/>
+
+
+ <delete includeemptydirs="true">
+ <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
+ <fileset dir="./${dir.publish}/${dir.js}/" includes="*.js" excludes="*.min.js"/>
+ </delete>
+
+ </target>
+
+ <!-- JS, Delete concatenated libs file (only if concat.scripts and delete.unoptimized are defined) -->
+ <target name="js.if.concat.scripts" if="build.delete.unoptimized, build.concat.scripts">
+ <delete file="./${dir.publish}/${dir.js}/libs.min.js"/>
+ <delete file="./${dir.publish}/${dir.js}/scripts.min.js"/>
+ </target>
+
+
+ <!--
+ CSS: concat style.css into ... one file. :)
+ run it through yui compressor for minification.
+ replace the reference to it in index.html
+
+ -->
+ <target name="css" depends="copy">
+ <echo message="Minifying css..."/>
+ <concat destfile="./${dir.publish}/${dir.css}/style.css">
+ <fileset file="./${dir.source}/${dir.css}/style.css"/>
+ </concat>
+ <apply executable="java" parallel="false">
+ <fileset dir="./${dir.publish}/${dir.css}/" includes="style.css"/>
+ <arg line="-jar"/>
+ <arg path="./${dir.tools}/${tool.yuicompressor}"/>
+ <srcfile/>
+ <arg line="-o"/>
+ <mapper type="glob" from="style.css" to="../${dir.publish}/${dir.css}/style.min.css"/>
+ <targetfile/>
+ </apply>
+ <replace token="style.css" value="style.min.css" file="./${dir.publish}/${file.index}"/>
+ <!-- <delete file="./publish/css/style.css"/> -->
+ </target>
+
+ <!--
+ IMAGES: png
+ -->
+ <target name="imagespng" depends="copy">
+ <echo message="Optimizing images"/>
+ <apply executable="optipng" osfamily="unix">
+ <arg value="-o7"/>
+ <fileset dir="./${dir.publish}/">
+ <include name="**/*.png"/>
+ </fileset>
+ </apply>
+ <apply executable="optipng" osfamily="mac">
+ <arg value="-o7"/>
+ <fileset dir="./${dir.publish}/">
+ <include name="**/*.png"/>
+ </fileset>
+ </apply>
+ <apply executable="tools/optipng-0.6.4-exe/optipng.exe" osfamily="windows">
+ <arg value="-o7"/>
+ <fileset dir="./${dir.publish}/">
+ <include name="**/*.png"/>
+ </fileset>
+ </apply>
+ </target>
+
+ <!--
+ IMAGES: jpg
+ -->
+ <target name="imagesjpg" depends="copy">
+ <echo message="Clean up those jpgs..."/>
+ <apply executable="jpegtran" osfamily="unix">
+ <fileset dir="./${dir.publish}/${dir.images}/" includes="*.jpg"/>
+ <arg value="-copy"/>
+ <!-- change 'all to 'none' in order to strip metadata
+ only do so if you own copyright to the image -->
+ <arg value="all"/>
+ <srcfile/>
+ <targetfile/>
+ <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
+ <mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
+ </apply>
+ <apply executable="jpegtran" osfamily="mac">
+ <fileset dir="./${dir.publish}/${dir.images}/" includes="*.jpg"/>
+ <arg value="-copy"/>
+ <!-- change 'all to 'none' in order to strip metadata
+ only do so if you own copyright to the image -->
+ <arg value="all"/>
+ <srcfile/>
+ <targetfile/>
+ <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
+ <mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
+ </apply>
+ <apply executable="tools/jpegtran.exe" osfamily="windows">
+ <fileset dir="./${dir.publish}/${dir.images}/" includes="*.jpg"/>
+ <arg value="-copy"/>
+ <!-- change 'all to 'none' in order to strip metadata
+ only do so if you own copyright to the image -->
+ <arg value="all"/>
+ <srcfile/>
+ <targetfile/>
+ <!-- you may want to flag optimized images. If so, do it here. Otherwise change this to type="identity" -->
+ <mapper type="glob" from="*.jpg" to="../${dir.publish}/${dir.images}/*.jpg"/>
+ </apply>
+ </target>
+
+
+
+ <!--
+ HTML: switch to minified jquery in the html
+
+ -->
+ <target name="usemin" depends="copy">
+ <echo message="Switching to minified js files..."/>
+
+ <!-- switch from a regular jquery to minified-->
+ <replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" file="./${dir.publish}/${file.index}" flags=""/>
+ <!-- switch any google CDN reference to minified -->
+ <replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" file="./${dir.publish}/${file.index}" flags=""/>
+
+ <echo>kill off those versioning flags: ?v=2</echo>
+ <replaceregexp match='\?v=\d+">' replace='">' file="./${dir.publish}/${file.index}" flags=""/>
+
+ </target>
+
+
+
+ <!--
+ HTML: replaces scripts with single concat'd one.
+ removes profiling code
+ -->
+
+ <target name="html" depends="">
+ <echo message="Clean up the html..."/>
+ <!-- style.css replacement handled as a replacetoken above -->
+ <replaceregexp match="&lt;!-- START CONCAT [\d\w\s\W]*?!-- END CONCAT --&gt;" file="./${dir.publish}/${file.index}" replace="&lt;script src='${dir.js}/scripts.min.js\'&gt;&lt;/script&gt;" flags="m"/>
+ <replaceregexp match="&lt;!-- yui profiler[\d\w\s\W]*?end profiling code --&gt;" file="./${dir.publish}/${file.index}" replace=" " flags="m"/>
+
+ <!--[! use comments like this one to avoid having them get minified -->
+
+ </target>
+
+ <!--
+ HTML Minification. There are three levels. htmlclean is default.
+ -->
+ <target name="htmlbuildkit" depends="html" >
+ <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.publish}/" includes="*.html"/>
+ <arg value="-jar"/>
+ <arg path="./${dir.build}/tools/htmlcompressor-0.9.3.jar"/>
+ <arg value="--preserve-comments"/>
+ <arg line="--preserve-multi-spaces"/>
+ <arg line="--type html"/>
+ <arg line="--compress-js"/>
+ <arg line="--compress-css"/>
+ <srcfile/>
+ <arg value="-o"/>
+ <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
+ <targetfile/>
+ </apply>
+ </target>
+
+ <target name="htmlclean" depends="html" >
+ <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.publish}/" includes="*.html"/>
+ <arg value="-jar"/>
+ <arg path="./${dir.build}/tools/htmlcompressor-0.9.3.jar"/>
+ <arg line="--type html"/>
+ <arg line="--preserve-multi-spaces"/>
+ <arg line="--remove-quotes"/>
+ <arg line="--compress-js"/>
+ <arg line="--compress-css"/>
+ <srcfile/>
+ <arg value="-o"/>
+ <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
+ <targetfile/>
+ </apply>
+ </target>
+
+ <target name="htmlcompress" depends="html" >
+ <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.publish}/" includes="*.html"/>
+ <arg value="-jar"/>
+ <arg path="./${dir.build}/tools/htmlcompressor-0.9.3.jar"/>
+ <arg line="--type html"/>
+ <arg line="--remove-quotes"/>
+ <arg line="--compress-js"/>
+ <arg line="--compress-css"/>
+ <srcfile/>
+ <arg value="-o"/>
+ <mapper type="glob" from="*.html" to="../${dir.publish}/*.html"/>
+ <targetfile/>
+ </apply>
+ </target>
+
+
+
+</project>
73 build/createproject.sh
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+
+#Generate a new project from your HTML5 Boilerplate repo clone
+#Created 2010-10-13, Rick Waldron
+
+
+##first run
+# $ cd html5-boilerplate/build
+# $ sudo chmod a+x createproject.sh && ./createproject.sh
+
+##usage
+# $ cd html5-boilerplate/build
+# $ ./createproject.sh
+
+echo "To create a new html5-boilerplate project, enter a new directory name:"
+
+read name
+
+cd ..
+
+webroot=$PWD
+
+SRC=$webroot"/html5-boilerplate"
+DST=$webroot"/../"$name
+
+if [ -d "$DST" ]
+then
+ echo "$DST exists"
+else
+ #create new project
+ mkdir $name
+
+ #sucess message
+ echo "Created Directory: $DST"
+
+ cd $SRC
+
+ #copy to new project directory
+ #http://en.wikipedia.org/wiki/Cpio#Copy
+ #http://cybertiggyr.com/cpio-howto/
+ #http://www.cyberciti.biz/faq/how-do-i-use-cpio-command-under-linux/
+ find . -depth -print0 | cpio -0pdmv $DST
+
+
+ #sucess message
+ echo "Created Project: $DST"
+
+ # delete that temporary folder
+ rm -r $name
+
+ #move into new project
+ cd $DST
+
+ #in Bourne Again Shell, the cpio was copying
+ #the whole dir into the new project, along with the contents
+ if [ -d "$DST/html5-boilerplate" ]
+ then
+ rm -r html5-boilerplate
+ fi
+
+ if [ -e "$DST/createproject.sh" ]
+ then
+ rm -r createproject.sh
+ fi
+
+ if [ -e "$DST/.git" ]
+ then
+ rm -rf .git
+ fi
+
+
+fi
+
52 build/default.properties
@@ -0,0 +1,52 @@
+# Build options ---------------------------------
+# Customize these to fit your needs
+
+# If set, concat libraries with main scripts file, producing single script file
+build.concat.scripts = true
+# If set, delete unoptimized files
+build.delete.unoptimized = true
+
+
+# Exclude file filter for publishing (can't be empty)
+# For example: ...<add example here>...
+file.exclude = nonexistentfile
+
+
+
+
+# Project structure -----------------------------
+
+# Directory names
+dir.publish = publish
+dir.build = build
+dir.tools = ${dir.build}/tools
+dir.test = test
+dir.demo = demo
+dir.js = js
+# Main JS script folder (Will be concatenated and minified)
+dir.js.main = ${dir.js}
+# JS libraries folder (Will be concatenated and minified)
+dir.js.mylibs = ${dir.js}/mylibs
+# Folder that should be only minified, not concatenated together
+dir.js.libs = ${dir.js}/libs
+dir.css = css
+dir.images = images
+
+# Files
+# all the html/php whatever that the build script will be mucking with.
+# For example: ...<add example here>...
+file.index = index.html
+
+
+
+
+
+# Hardcore build options... --------------------
+
+# Build Versioning
+build.info = buildinfo.properties
+
+# Tools
+tool.yuicompressor = yuicompressor-2.4.2.jar
+
+
BIN build/tools/htmlcompressor-0.9.3.jar
Binary file not shown.
BIN build/tools/jpegtran.exe
Binary file not shown.
21 build/tools/optipng-0.6.4-exe/LICENSE.txt
@@ -0,0 +1,21 @@
+
+Copyright (C) 2001-2010 Cosmin Truta.
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the author(s) be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
+
2 build/tools/optipng-0.6.4-exe/OptiPNG.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=http://optipng.sourceforge.net/
32 build/tools/optipng-0.6.4-exe/doc/caveat.txt
@@ -0,0 +1,32 @@
+
+CAVEAT EMPTOR
+=============
+(known bugs, problems or limitations)
+
+
+Legend
+------
+ - Minor bug, limitation, or incompletely-implemented feature.
+ ! Bug that may lead to a behavior different than expected,
+ but without any serious consequence.
+!! Bug that may cause accidental data loss, security hazard,
+ or another serious consequence.
+ * Another problematic issue, that is not necessarily a bug.
+
+
+Version 0.6.4 14-mar-2010
+-------------
+ - Lossless image reductions are not completely implemented.
+ (This does NOT affect the integrity of PNG files.)
+ Here are the missing pieces:
+ - The color palette reductions are implemented only partially.
+ - The bit depth reductions below 8, for grayscale images, are
+ not implemented yet.
+
+ - TIFF support is limited to uncompressed, PNG-compatible
+ color spaces (grayscale, RGB and RGBA).
+
+ - Metadata is not imported from the external image formats.
+
+ - There is no support for pipes or streams.
+
318 build/tools/optipng-0.6.4-exe/doc/history.txt
@@ -0,0 +1,318 @@
+
+OptiPNG - Revision history
+==========================
+
+Legend
+------
+++ Added or improved performance-related feature
+ (might improve compression ratio or processing speed).
+ + Added or improved feature.
+ - Removed feature.
+ ! Fixed bug.
+!! Fixed dangerous bug
+ (data/metadata loss or serious security hazard).
+ * Other modification (e.g. architectural improvement).
+
+
+Version 0.6.4 14-mar-2010
+-------------
+ + Upgraded libpng to version 1.4.1-optipng [private]
+ + Upgraded zlib to version 1.2.4-optipng [private]
+ + Added the option -nx.
+ * Clarified the behavior of -nz and the relation between -nz and -o0.
+ + Added a filesystem check (resolving normalized paths, symlinks, etc.)
+ to better detect when the output overwrites the input.
+ + Enabled automatic wildcard expansion (i.e. globbing) on Win64.
+ ! Fixed a Unicode build issue on Windows.
+ (Thanks to Fabien Barbier for the fix.)
+
+
+Version 0.6.3 18-may-2009
+-------------
+ + Upgraded libpng to version 1.2.36-optipng [private]
+!! Fixed a use-after-free error in the GIF reader.
+ (Thanks to Roy Tam for the report, and to Bryan McQuade for the fix.)
+ ! Flushed the output log to display the current trial in real time.
+ This only worked on Windows in the previous version.
+ (Thanks to Vincent Lefevre for the fix.)
+ ! Fixed an error in reporting unrecognized file formats.
+ (Thanks to [LaughingMan] for the report.)
+ - Removed the requirement to "fix" TIFF files that contain unrecognized
+ metadata. (Thanks to Piotr Bandurski for the suggestion.)
+ * Simplified the option abbreviation rules. Option names can now be
+ abbreviated to their shortest unique prefix, as in X11 applications.
+
+
+Version 0.6.2 9-nov-2008
+-------------
+ + Upgraded libpng to version 1.2.33-optipng [private]
+++ Put back a speed optimization, accidentally removed in version 0.6,
+ allowing singleton trials (-o1) to be bypassed in certain conditions.
+!! Fixed an array overflow in the BMP reader.
+!! Fixed the loss of private chunks under the -snip option.
+ + Produced a more concise on-screen output in the non-verbose mode.
+ (Thanks to Vincent Lefevre for the contribution.)
+ * Added a programming interface to the optimization engine, in order
+ to facilitate the development of PNG-optimizing GUI apps and plugins.
+
+
+Version 0.6.1 20-jul-2008
+-------------
+ * Upgraded cexcept to version 2.0.1.
+ + Added a configure script, to be used instead of unix-secure.mak.
+ ! Fixed a build issue that occured when using libpng from the system.
+ (Thanks to Nelson A. de Oliveira for the report.)
+ ! Fixed processing when image reduction yields an output larger than
+ the original. (Thanks to Michael Krishtopa for the report.)
+ ! Fixed behavior of -preserve.
+ (Thanks to Bill Koch for the report.)
+ - Removed displaying of partial progress when abandoning IDATs under
+ the -v option. The percentages displayed were not very accurate.
+
+
+Version 0.6 15-jun-2008
+-----------
+ + Upgraded libpng to version 1.2.29-optipng [private]
+++ Implemented grayscale(alpha)-to-palette reductions.
+++ Improved conversion of bKGD info during RGB-to-palette reductions.
+ (Thanks to Matthew Fearnley for the contribution.)
+!! Fixed conversion of bKGD and tRNS during 16-to-8-bit reductions.
+ (Thanks to Matthew Fearnley for the report.)
+ + Added support for compressed BMP (incl. PNG-compressed BMP, you bet!)
+ + Improved the speed of reading raw PNM files.
+ + Recognized PNG digital signatures (dSIG) and disabled optimization
+ in their presence, to preserve their integrity.
+ + Allowed the user to enforce the optimization of dSIG'ed files.
+ + Recognized APNG animation files and disabled reductions to preserve
+ their integrity.
+ + Added the -snip option, to allow the user to "snip" one image out of
+ a multi-image file, such as animated GIF, multi-page TIFF, or APNG.
+ (Thanks to [LaughingMan] for the suggestion.)
+ + Improved recovery of PNG files with incomplete IDAT.
+!! Fixed a crash triggered by the use of -log on some platforms.
+ (Thanks to Stefan Bruns for the fix.)
+ ! Fixed behavior of -out and -dir when the input is already optimized.
+ (Thanks to Christian Davideck for the report.)
+ * Provided more detailed image information at the start of processing.
+ * Provided a more detailed summary at the end of processing, under the
+ presence of the -v option and/or the occurence of exceptional events.
+
+
+Version 0.5.5 28-jan-2007
+-------------
+ + Upgraded libpng to version 1.2.15-optipng [private]
+++ Used a previously-missed RGB-to-palette reduction opportunity
+ for images containing 256 distinct colors.
+ (Thanks to Joachim Kluge for the report.)
+!! Fixed conversion of bKGD info during RGB-to-palette reductions.
+ (Thanks to Matthew Fearnley for the report.)
+ ! Fixed pre-computation of iterations.
+ (Thanks to Matthew Fearnley for the report.)
+ ! Eliminated a false alarm when processing RGB images with tRNS
+ in Unix-secure mode. (Thanks to Till Maas for the report, and
+ thanks to Nelson A. de Oliveira for the fix.)
+ ! Fixed behavior of -out and -dir when changing interlacing.
+ (Thanks to Martin Packman for the report.)
+ ! Fixed the behavior of "-dir [DRIVE]:" on Windows.
+
+
+Version 0.5.4 11-aug-2006
+-------------
+ + Added user options -out and -dir, to specify the name of
+ the output file or directory.
+ (Thanks to Alexander Lucas for the suggestion.)
+ * Added support for builds based on the system-supplied libpng.
+ (Thanks to Nelson A. de Oliveira for the valuable help.)
+
+
+Version 0.5.3 23-jul-2006
+-------------
+ + Upgraded libpng to version 1.2.12-optipng [private]
+ + Implemented basic support for TIFF (grayscale, RGB and RGBA,
+ uncompressed).
+++ Avoided the redundant trial when the search space is singular
+ (e.g. when running "optipng -o1 example.tif").
+ + Prevented accidental file corruption when using option "-log".
+ ! Fixed (again) a small typo in the online help.
+
+
+Version 0.5.2 7-may-2006
+-------------
+ + Improved handling of inexact PNM-to-PNG conversions.
+ ! Fixed a typo that was breaking the build on some Unix platforms.
+ (Thanks to Aaron Reitz for the report.)
+
+
+Version 0.5.1 30-apr-2006
+-------------
+++ Implemented bit depth reduction for palette images.
+ + Upgraded libpng to version 1.2.10-optipng [private]
+ + Improved the BMP support.
+ + Added a Unix man page.
+ (Thanks to Nelson A. de Oliveira for the contribution.)
+ + Allowed abbreviation of command-line options.
+ + Changed user option -log to accept a file name as an argument.
+ * Changed user option -no to -simulate.
+ ! Fixed an error in handling .bak files on Unix.
+ (Thanks to Adam Szojda and Nelson A. de Oliveira for the report.)
+ ! Fixed a small typo in the help screen.
+ (Thanks to A. Costa and Nelson A. de Oliveira for the report.)
+
+
+Version 0.5 14-jan-2006
+-----------
+++ Added pngxtern, a libpng add-on for external image format
+ support: BMP (uncompressed), GIF, PNM.
+ (This was incorporated from OptiPNG-Plus.)
+++ Implemented RGB(A)-to-palette reductions.
+ + Upgraded zlib to version 1.2.3-optipng [private]
+ + Upgraded libpng to version 1.2.8-optipng [private]
+ + If trials are ended prematurely, detailed progression is only
+ reported under the user option -v.
+ - Removed reporting of some IDAT sizes that exceeded the optimum.
+ (This was NOT a bug, but a "feature" that confused some users.)
+ ! Fixed an RGB-to-gray reduction problem that occured under some
+ specific background colors.
+ * Added support for builds based on the system-supplied zlib.
+ (Thanks to Nelson A. de Oliveira for the suggestion.)
+ * Modified LICENSE. It is now a verbatim spell of the zlib license.
+
+
+Version 0.4.8 10-may-2005
+-------------
+ + Upgraded libpng to version 1.0.18-optipng [private]
+!! Fixed a palette-to-gray reduction problem that occurred when an
+ RGB triple had both an alpha below max, and an alpha equal to max.
+ (Thanks to Nicolas Le Gland for the report.)
+ + Packed the Windows executable using UPX.
+ (Thanks to [Warriant] for the suggestion.)
+
+
+Version 0.4.7 30-oct-2004
+-------------
+!! Fixed a palette-to-gray reduction problem that occurred when
+ having more than one alpha value per RGB triple.
+ (Thanks to Larry Hastings for the report.)
+ ! Fixed the progress display, when processing very large images.
+ + Displayed the image info at the beginning of processing.
+++ Reduced the IDAT buffer size, allowing abandoned trials to
+ terminate earlier in some circumstances.
+ + Implemented error recovery, when PLTE is too small, and/or
+ tRNS is too large.
+
+
+Version 0.4.6 25-oct-2004
+-------------
+ + Upgraded zlib to version 1.2.2-optipng [private]
+ + Upgraded libpng to version 1.0.17-optipng [private]
+ This provides safe handling of some ill-formed PNG images.
+ + Rewrote makefiles.
+ + Added project workspace to build under Visual C++ 6.0,
+ integrated with memory leak detection.
+++ Implemented a premature termination of trials, in the moment
+ when IDAT grows beyond the smallest size previously achieved.
+ (Thanks to Larry Hastings for the idea.)
+ + Changed the order of trials, to perform the trials that are
+ more likely to yield a smaller IDAT, at the beginning.
+ + Added user option -full to avoid the premature termination of
+ trials; useful for debugging.
+
+
+Version 0.4.5 31-may-2004
+-------------
+ + Upgraded zlib to version 1.2.1.f-cos2 [private]
+ + Upgraded libpng to version 1.0.15-cos2 [private]
+ * Changed user option -nx to -nz.
+ + Added user option to preserve file attributes (file mode,
+ time stamp, etc.) when applicable.
+ (Thanks to Nehal Mistry for the suggestion.)
+ ! Fixed an incorrect initialization of zlib window bits.
+ ! Displayed an error message when the search space was invalid.
+!! Fixed a palette reduction problem for bit depths below 8.
+ ! Eliminated memory leaks.
+ (Thanks to Niels de Koning for the help.)
+
+
+Version 0.4.4 20-nov-2003
+-------------
+ + Upgraded zlib to version 1.2.1
+++ Added support for the Z_RLE strategy.
+
+
+Version 0.4.3 12-aug-2003
+-------------
+ ! Fixed a reduction problem that caused an assertion failure.
+ (Thanks to Dimitri Papadopoulos for the report.)
+
+
+Version 0.4.2 30-jun-2003
+-------------
+++ Enhanced the support for palette size reductions:
+ trailing sterile palette entries are removed even when
+ the bit depth is below 8.
+ ! Enforced recompression when the new IDAT has the same size,
+ but other chunks have been reduced.
+ + Displayed the IDAT size difference as a percentage.
+ (Thanks to Nehal Mistry for the suggestion.)
+
+
+Version 0.4.1 19-may-2003
+-------------
+ ! Fixed the removal of trailing sterile palette entries.
+
+
+Version 0.4 12-may-2003
+-----------
+++ Added support for palette-to-gray reductions.
+++ Added partial support for palette size reductions.
+ ! Fixed the reporting of invalid command-line options.
+ ! Eliminated a spurious warning when the zlib window size
+ is set to 256.
+
+
+Version 0.3.2 11-mar-2003
+-------------
+ + Added support for updating sBIT during reductions.
+ ! Fixed the reduction of the alpha channel.
+
+
+Version 0.3.1 25-feb-2003
+-------------
+ ! Fixed the encoding of interlaced images when they become
+ larger than the input.
+ (Thanks to James H. Cloos, Jr. for the report.)
+ + Added the HISTORY document (this file).
+
+
+Version 0.3 24-feb-2003
+-----------
+This is the first public release of OptiPNG.
+++ Added support for iterating through zlib memory levels.
+++ Added support for collapsing IDAT, avoiding calls to
+ png_set_compression_buffer_size().
+ This reduces the memory requirements.
+++ Added support for lossless reduction of the image type:
+ RGB[A] -> G[A], RGBA -> RGB, GA -> G
+ + Added many user options.
+ + Added documentation.
+
+
+Version 0.2 27-dec-2001
+-----------
+ + Added support for optimization level presets.
+ + Added user option for changing the interlacing.
+
+
+Version 0.1 17-dec-2001
+-----------
+ + Added support for chunk I/O status annotation.
+ This improves the speed of OptiPNG significantly.
+ * Structured exception handling is provided by cexcept.
+
+
+Version 0.0 10-dec-2001
+-----------
+This is the very first version of OptiPNG.
+It compresses IDAT repeatedly, iterating through zlib compression
+and strategy levels, and PNG filters.
+
677 build/tools/optipng-0.6.4-exe/doc/manual.html
@@ -0,0 +1,677 @@
+<!-- Creator : groff version 1.19.2 -->
+<!-- CreationDate: Sun Mar 14 12:29:16 2010 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; }
+ pre { margin-top: 0; margin-bottom: 0; }
+ table { margin-top: 0; margin-bottom: 0; }
+</style>
+<title>OPTIPNG</title>
+
+</head>
+<body>
+
+<h1 align=center>OPTIPNG</h1>
+
+<hr>
+
+
+<a name="NAME"></a>
+<h2>NAME</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>OptiPNG</b>
+&minus; Advanced optimization program for <b>Portable
+Network Graphics (PNG)</b></p>
+
+<a name="SYNOPSIS"></a>
+<h2>SYNOPSIS</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>optipng</b>
+[<b>&minus;?</b> | <b>&minus;h</b> | <b>&minus;help</b>]
+<b><br>
+optipng</b> [<i>options...</i>] <i>files...</i></p>
+
+<a name="DESCRIPTION"></a>
+<h2>DESCRIPTION</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">The
+<b>OptiPNG</b> program shall attempt to <i>optimize</i> PNG
+files, i.e. reduce their size to a minimum, without losing
+any information. In addition, this program shall perform a
+suite of auxiliary functions like integrity checks, metadata
+recovery and pixmap-to-PNG conversion.</p>
+
+<p style="margin-left:11%; margin-top: 1em">The
+optimization attempts are not guaranteed to succeed. Valid
+PNG files that cannot be optimized by this program are
+normally left intact; their size will not grow. The user may
+request to override this default behavior.</p>
+
+<a name="FILES"></a>
+<h2>FILES</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">The input files
+are raster image files encoded either in PNG format (the
+native format), or in an external format. The currently
+supported external formats are GIF, BMP, PNM and TIFF.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>OptiPNG</b>
+processes each image file given in the command line as
+follows:</p>
+
+<p style="margin-left:11%; margin-top: 1em">&minus; If it
+is in PNG format:</p>
+
+<p style="margin-left:22%; margin-top: 1em">Attempt to
+optimize the given file in-place. If optimization is
+successful, or if the option <b>&minus;force</b> is in
+effect, replace the original file with its optimized
+version. The original file is backed up if the option
+<b>&minus;keep</b> is in effect.</p>
+
+<p style="margin-left:11%; margin-top: 1em">&minus; If it
+is in an external format:</p>
+
+<p style="margin-left:22%; margin-top: 1em">Create an
+optimized PNG version of the given file. The output file
+name is composed from the original file name and the
+<tt>.png</tt> extension.</p>
+
+<a name="OPTIONS"></a>
+<h2>OPTIONS</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>General
+options <br>
+-?</b>, <b>&minus;h</b>, <b>&minus;help</b></p>
+
+<p style="margin-left:22%;">Show a complete summary of
+options.</p>
+
+<p style="margin-left:11%;"><b>&minus;o</b>
+<i>level</i></p>
+
+<p style="margin-left:22%;">Select the optimization level.
+<br>
+The optimization level 0 enables a set of optimization
+operations that require minimal effort. There will be no
+changes to image attributes like bit depth or color type,
+and no recompression of existing IDAT datastreams. <br>
+The optimization level 1 enables a single IDAT compression
+trial. The trial chosen is what <b>OptiPNG</b> <i>thinks</i>
+it&rsquo;s probably the most effective. <br>
+The optimization levels 2 and higher enable multiple IDAT
+compression trials; the higher the level, the more trials.
+<br>
+The behavior and the default value of this option may change
+across different program versions. Use the option
+<b>&minus;h</b> to see the details pertaining to your
+specific version.</p>
+
+<p style="margin-left:11%;"><b>&minus;dir</b>
+<i>directory</i></p>
+
+<p style="margin-left:22%;">Write output file(s) to
+<i>directory</i>.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="6%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;fix</b></p> </td>
+<td width="5%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Enable error
+recovery. This option has no effect on valid input
+files.</p> </td>
+</table>
+
+<p style="margin-left:22%;">The program will spend a
+reasonable amount of effort to recover as much data as
+possible, without increasing the output file size, but the
+success cannot be generally guaranteed. The program may even
+increase the file size, e.g., by reconstructing missing
+critical data. Under this option, integrity shall take
+precedence over file size. <br>
+When this option is not used, the invalid input files are
+left unprocessed.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="9%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;force</b></p> </td>
+<td width="2%"></td>
+<td width="56%">
+
+
+<p style="margin-top: 1em" valign="top">Enforce writing of
+a new output file.</p></td>
+<td width="22%">
+</td>
+</table>
+
+<p style="margin-left:22%;">This option overrides the
+program&rsquo;s decision not to write such file, e.g. when
+the PNG input is digitally signed (using dSIG), or when the
+PNG output becomes larger than the PNG input.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="7%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;keep</b></p> </td>
+<td width="4%"></td>
+<td width="58%">
+
+
+<p style="margin-top: 1em" valign="top">Keep a backup of
+the modified file(s).</p></td>
+<td width="20%">
+</td>
+</table>
+
+<p style="margin-left:22%;">The files that use the backup
+names prior to the program execution are <i>not</i>
+overwritten.</p>
+
+<p style="margin-left:11%;"><b>&minus;log</b>
+<i>file</i></p>
+
+<p style="margin-left:22%;">Log messages to <i>file</i>.
+For safety reasons, <i>file</i> must have the extension
+<tt>.log</tt>.</p>
+
+<p style="margin-left:11%;"><b>&minus;out</b>
+<i>file</i></p>
+
+<p style="margin-left:22%;">Write output file to
+<i>file</i>. The command line must contain exactly one input
+file.</p>
+
+<p style="margin-left:11%;"><b>&minus;preserve</b></p>
+
+<p style="margin-left:22%;">Preserve file attributes (time
+stamps, file access rights, etc.) where applicable.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="9%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;quiet</b></p> </td>
+<td width="2%"></td>
+<td width="27%">
+
+
+<p style="margin-top: 1em" valign="top">Run in quiet
+mode.</p> </td>
+<td width="51%">
+</td>
+</table>
+
+<p style="margin-left:22%;">These messages are still
+written to the log file if the option <b>&minus;log</b> is
+in effect.</p>
+
+<p style="margin-left:11%;"><b>&minus;simulate</b></p>
+
+<p style="margin-left:22%;">Run in simulation mode: perform
+the trials, but do not create output files.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="7%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;snip</b></p> </td>
+<td width="4%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Cut one image out
+of multi-image, animation or video file(s).</p></td>
+</table>
+
+<p style="margin-left:22%;">Depending on the input format,
+this may be either the first or the most relevant (e.g. the
+largest) image.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;v</b></p> </td>
+<td width="8%"></td>
+<td width="63%">
+
+
+<p style="margin-top: 1em" valign="top">Enable the options
+<b>&minus;verbose</b> and <b>&minus;version</b>.</p></td>
+<td width="15%">
+</td>
+</table>
+
+<p style="margin-left:11%;"><b>&minus;verbose</b></p>
+
+<p style="margin-left:22%;">Run in verbose mode.</p>
+
+<p style="margin-left:11%;"><b>&minus;version</b></p>
+
+<p style="margin-left:22%;">Show copyright, version and
+build info.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;&minus;</b></p> </td>
+<td width="8%"></td>
+<td width="41%">
+
+
+<p style="margin-top: 1em" valign="top">Stop option switch
+parsing.</p> </td>
+<td width="37%">
+</td>
+</table>
+
+<p style="margin-left:11%; margin-top: 1em"><b>PNG encoding
+and optimization options <br>
+&minus;f</b> <i>filters</i></p>
+
+<p style="margin-left:22%;">Select the PNG delta filters.
+<br>
+The <i>filters</i> argument is specified as a rangeset (e.g.
+<b>&minus;f0&minus;5</b>), and the default <i>filters</i>
+value depends on the optimization level set by the option
+<b>&minus;o</b>. <br>
+The filter values 0, 1, 2, 3 and 4 indicate static
+filtering, and correspond to the standard PNG filter codes
+(<i>None</i>, <i>Left</i>, <i>Up</i>, <i>Average</i> and
+<i>Paeth</i>, respectively). The filter value 5 indicates
+adaptive filtering, whose effect is defined by the
+<b>libpng</b>(3) library used by <b>OptiPNG</b>.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="7%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;full</b></p> </td>
+<td width="4%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Produce a full
+report on IDAT. This option might slow down the trials.</p></td>
+</table>
+
+<p style="margin-left:11%;"><b>&minus;i</b> <i>type</i></p>
+
+<p style="margin-left:22%;">Select the interlace type
+(0&minus;1). <br>
+If the interlace type 0 is selected, the output image shall
+be non-interlaced (i.e. progressive-scanned). If the
+interlace type 1 is selected, the output image shall be
+interlaced using the <i>Adam7</i> method. <br>
+By default, the output shall have the same interlace type as
+the input.</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="4%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;nb</b></p> </td>
+<td width="7%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Do not apply bit
+depth reduction.</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="4%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;nc</b></p> </td>
+<td width="7%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Do not apply color
+type reduction.</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="4%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;np</b></p> </td>
+<td width="7%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Do not apply
+palette reduction.</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="4%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;nx</b></p> </td>
+<td width="7%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Do not apply any
+lossless image reduction: enable the options
+<b>&minus;nb</b>, <b>&minus;nc</b> and <b>&minus;np</b>.</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="4%">
+
+
+
+<p style="margin-top: 1em" valign="top"><b>&minus;nz</b></p> </td>
+<td width="7%"></td>
+<td width="78%">
+
+
+<p style="margin-top: 1em" valign="top">Do not recode IDAT
+datastreams.</p> </td>
+</table>
+
+<p style="margin-left:22%;">The IDAT optimization
+operations that do not require recoding (e.g. IDAT chunk
+concatenation) are still performed. <br>
+This option has effect on PNG input files only.</p>
+
+<p style="margin-left:11%;"><b>&minus;zc</b>
+<i>levels</i></p>
+
+<p style="margin-left:22%;">Select the zlib compression
+levels used in IDAT compression. <br>
+The <i>levels</i> argument is specified as a rangeset (e.g.
+<b>&minus;zc6&minus;9</b>), and the default <i>levels</i>
+value depends on the optimization level set by the option
+<b>&minus;o</b>. <br>
+The effect of this option is defined by the <b>zlib</b>(3)
+library used by <b>OptiPNG</b>.</p>
+
+<p style="margin-left:11%;"><b>&minus;zm</b>
+<i>levels</i></p>
+
+<p style="margin-left:22%;">Select the zlib memory levels
+used in IDAT compression. <br>
+The <i>levels</i> argument is specified as a rangeset (e.g.
+<b>-zm8&minus;9</b>), and the default <i>levels</i> value
+depends on the optimization level set by the option
+<b>&minus;o</b>. <br>
+The effect of this option is defined by the <b>zlib</b>(3)
+library used by <b>OptiPNG</b>.</p>
+
+<p style="margin-left:11%;"><b>&minus;zs</b>
+<i>strategies</i></p>
+
+<p style="margin-left:22%;">Select the zlib compression
+strategies used in IDAT compression. <br>
+The <i>strategies</i> argument is specified as a rangeset
+(e.g. <b>-zs0&minus;3</b>), and the default
+<i>strategies</i> value depends on the optimization level
+set by the option <b>&minus;o</b>. <br>
+The effect of this option is defined by the <b>zlib</b>(3)
+library used by <b>OptiPNG</b>.</p>
+
+<p style="margin-left:11%;"><b>&minus;zw</b>
+<i>size</i></p>
+
+<p style="margin-left:22%;">Select the zlib window size
+(32k,16k,8k,4k,2k,1k,512,256) used in IDAT compression. <br>
+The <i>size</i> argument can be specified either in bytes
+(e.g. 16384) or kilobytes (e.g. 16k). The default
+<i>size</i> value is set to the lowest window size that
+yields an IDAT output as big as if yielded by the value
+32768. <br>
+The effect of this option is defined by the <b>zlib</b>(3)
+library used by <b>OptiPNG</b>.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Notes</b>
+<br>
+Options may come in any order (except for
+<b>&minus;&minus;</b>), before, after, or alternating with
+file names. Option names are case-insensitive and may be
+abbreviated to their shortest unique prefix.</p>
+
+<p style="margin-left:11%; margin-top: 1em">Some options
+may have arguments that follow the option name, separated by
+whitespace or the equal sign (&rsquo;<b>=</b>&rsquo;). If
+the option argument is a number or a rangeset, the separator
+may be omitted. For example:</p>
+
+
+<p style="margin-left:22%; margin-top: 1em"><b>&minus;out</b>
+<tt>newfile.png</tt> &lt;=&gt;
+<b>&minus;out=</b><tt>newfile.png</tt> <b><br>
+&minus;o3</b> &lt;=&gt; <b>&minus;o&nbsp;3</b> &lt;=&gt;
+<b>&minus;o=3 <br>
+&minus;f0,3&minus;5</b> &lt;=&gt;
+<b>&minus;f&nbsp;0,3&minus;5</b> &lt;=&gt;
+<b>&minus;f=0,3&minus;5</b></p>
+
+<p style="margin-left:11%; margin-top: 1em">Rangeset
+arguments are cumulative; e.g.</p>
+
+<p style="margin-left:22%; margin-top: 1em"><b>&minus;f0
+&minus;f3&minus;5</b> &lt;=&gt; <b>&minus;f0,3&minus;5 <br>
+&minus;zs0 &minus;zs1 &minus;zs2&minus;3</b> &lt;=&gt;
+<b>&minus;zs0,1,2,3</b> &lt;=&gt;
+<b>&minus;zs0&minus;3</b></p>
+
+<a name="EXTENDED DESCRIPTION"></a>
+<h2>EXTENDED DESCRIPTION</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">The PNG
+optimization algorithm consists of the following steps:</p>
+
+<table width="100%" border=0 rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+<p style="margin-top: 1em" valign="top">1.</p></td>
+<td width="3%"></td>
+<td width="83%">
+
+
+<p style="margin-top: 1em" valign="top">Reduce the bit
+depth, the color type and the color palette of the image.
+This step may reduce the size of the uncompressed image,
+which, indirectly, may reduce the size of the compressed
+image (i.e. the size of the output PNG file).</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+<p style="margin-top: 1em" valign="top">2.</p></td>
+<td width="3%"></td>
+<td width="83%">
+
+
+<p style="margin-top: 1em" valign="top">Run a suite of
+compression methods and strategies and select the
+compression parameters that yield the smallest output
+file.</p> </td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+<p style="margin-top: 1em" valign="top">3.</p></td>
+<td width="3%"></td>
+<td width="83%">
+
+
+<p style="margin-top: 1em" valign="top">Store all IDAT
+contents into a single chunk, eliminating the overhead
+incurred by repeated IDAT headers and CRCs.</p></td>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="3%">
+
+
+<p style="margin-top: 1em" valign="top">4.</p></td>
+<td width="3%"></td>
+<td width="83%">
+
+
+<p style="margin-top: 1em" valign="top">Set the zlib window
+size inside IDAT to a mininum that does not affect the
+compression ratio, reducing the memory requirements of PNG
+decoders.</p> </td>
+</table>
+
+<p style="margin-left:11%; margin-top: 1em">Not all of the
+above steps need to be executed. The behavior depends on the
+actual input files and user options.</p>
+
+<p style="margin-left:11%; margin-top: 1em">Step 1 may be
+customized via the no-reduce options <b>&minus;nb</b>,
+<b>&minus;nc</b>, <b>&minus;np</b> and <b>&minus;nx</b>.
+Step 2 may be customized via the <b>&minus;o</b> option, and
+may be fine-tuned via the options <b>&minus;zc</b>,
+<b>&minus;zm</b>, <b>&minus;zs</b> and <b>&minus;zw</b>.
+Step 3 is always executed. Step 4 is executed only if a new
+IDAT is being created, and may be fine-tuned via the option
+<b>&minus;zw</b>.</p>
+
+<p style="margin-left:11%; margin-top: 1em">Extremely
+exhaustive searches are not generally expected to yield
+significant improvements in compression ratio, and are
+recommended to advanced users only.</p>
+
+<a name="EXAMPLES"></a>
+<h2>EXAMPLES</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><tt>optipng
+file1.png file2.gif file3.tif</tt></p>
+
+<p style="margin-left:11%; margin-top: 1em"><tt>optipng
+&minus;o5 file1.png file2.gif file3.tif</tt></p>
+
+<p style="margin-left:11%; margin-top: 1em"><tt>optipng
+&minus;i1 &minus;o7 &minus;v &minus;full &minus;sim
+experiment.png</tt></p>
+
+<a name="BUGS"></a>
+<h2>BUGS</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Lossless image
+reductions are not completely implemented. (This does NOT
+affect the integrity of the output files.) Here are the
+missing pieces:</p>
+
+<p style="margin-left:22%; margin-top: 1em">&minus; The
+color palette reductions are implemented only partially.
+<br>
+&minus; The bit depth reductions below 8, for grayscale
+images, are not implemented yet.</p>
+
+<p style="margin-left:11%; margin-top: 1em">TIFF support is
+limited to uncompressed, PNG-compatible (grayscale, RGB and
+RGBA) images.</p>
+
+<p style="margin-left:11%; margin-top: 1em">Metadata is not
+imported from the external image formats.</p>
+
+<p style="margin-left:11%; margin-top: 1em">There is no
+support for pipes or streams.</p>
+
+<a name="SEE ALSO"></a>
+<h2>SEE ALSO</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>png</b>(5),
+<b>libpng</b>(3), <b>zlib</b>(3), <b>pngcrush</b>(1),
+<b>pngrewrite</b>(1).</p>
+
+<a name="STANDARDS"></a>
+<h2>STANDARDS</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">The files
+produced by <b>OptiPNG</b> are compliant with
+<b>PNG&minus;2003</b>: <br>
+Glenn Randers-Pehrson et al. <i>Portable Network Graphics
+(PNG) Specification, Second Edition</i>. <br>
+W3C Recommendation 10 November 2003; ISO/IEC IS 15948:2003
+(E). <tt><br>
+http://www.w3.org/TR/PNG/</tt></p>
+
+<a name="AUTHOR"></a>
+<h2>AUTHOR</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>OptiPNG</b>
+is written and maintained by Cosmin Truta.</p>
+
+<p style="margin-left:11%; margin-top: 1em">This manual
+page was originally written by Nelson A. de Oliveira for the
+Debian Project. It was later updated by Cosmin Truta, and is
+now part of the <b>OptiPNG</b> distribution.</p>
+<hr>
+</body>
+</html>
BIN build/tools/optipng-0.6.4-exe/doc/manual.pdf
Binary file not shown.
280 build/tools/optipng-0.6.4-exe/doc/manual.txt
@@ -0,0 +1,280 @@
+OPTIPNG(1) OPTIPNG(1)
+
+NAME
+ OptiPNG - Advanced optimization program for Portable Network Graphics
+ (PNG)
+
+SYNOPSIS
+ optipng [-? | -h | -help]
+ optipng [options...] files...
+
+DESCRIPTION
+ The OptiPNG program shall attempt to optimize PNG files, i.e. reduce
+ their size to a minimum, without losing any information. In addition,
+ this program shall perform a suite of auxiliary functions like
+ integrity checks, metadata recovery and pixmap-to-PNG conversion.
+
+ The optimization attempts are not guaranteed to succeed. Valid PNG
+ files that cannot be optimized by this program are normally left
+ intact; their size will not grow. The user may request to override this
+ default behavior.
+
+FILES
+ The input files are raster image files encoded either in PNG format
+ (the native format), or in an external format. The currently supported
+ external formats are GIF, BMP, PNM and TIFF.
+
+ OptiPNG processes each image file given in the command line as follows:
+
+ - If it is in PNG format:
+
+ Attempt to optimize the given file in-place. If optimization is
+ successful, or if the option -force is in effect, replace the
+ original file with its optimized version. The original file is
+ backed up if the option -keep is in effect.
+
+ - If it is in an external format:
+
+ Create an optimized PNG version of the given file. The output
+ file name is composed from the original file name and the .png
+ extension.
+
+OPTIONS
+ General options
+ -?, -h, -help
+ Show a complete summary of options.
+
+ -o level
+ Select the optimization level.
+ The optimization level 0 enables a set of optimization opera-
+ tions that require minimal effort. There will be no changes to
+ image attributes like bit depth or color type, and no recompres-
+ sion of existing IDAT datastreams.
+ The optimization level 1 enables a single IDAT compression
+ trial. The trial chosen is what OptiPNG thinks it's probably the
+ most effective.
+ The optimization levels 2 and higher enable multiple IDAT com-
+ pression trials; the higher the level, the more trials.
+ The behavior and the default value of this option may change
+ across different program versions. Use the option -h to see the
+ details pertaining to your specific version.
+
+ -dir directory
+ Write output file(s) to directory.
+
+ -fix Enable error recovery. This option has no effect on valid input
+ files.
+ The program will spend a reasonable amount of effort to recover
+ as much data as possible, without increasing the output file
+ size, but the success cannot be generally guaranteed. The pro-
+ gram may even increase the file size, e.g., by reconstructing
+ missing critical data. Under this option, integrity shall take
+ precedence over file size.
+ When this option is not used, the invalid input files are left
+ unprocessed.
+
+ -force Enforce writing of a new output file.
+ This option overrides the program's decision not to write such
+ file, e.g. when the PNG input is digitally signed (using dSIG),
+ or when the PNG output becomes larger than the PNG input.
+
+ -keep Keep a backup of the modified file(s).
+ The files that use the backup names prior to the program execu-
+ tion are not overwritten.
+
+ -log file
+ Log messages to file. For safety reasons, file must have the
+ extension .log.
+
+ -out file
+ Write output file to file. The command line must contain
+ exactly one input file.
+
+ -preserve
+ Preserve file attributes (time stamps, file access rights, etc.)
+ where applicable.
+
+ -quiet Run in quiet mode.
+ These messages are still written to the log file if the option
+ -log is in effect.
+
+ -simulate
+ Run in simulation mode: perform the trials, but do not create
+ output files.
+
+ -snip Cut one image out of multi-image, animation or video file(s).
+ Depending on the input format, this may be either the first or
+ the most relevant (e.g. the largest) image.
+
+ -v Enable the options -verbose and -version.
+
+ -verbose
+ Run in verbose mode.
+
+ -version
+ Show copyright, version and build info.
+
+ -- Stop option switch parsing.
+
+ PNG encoding and optimization options
+ -f filters
+ Select the PNG delta filters.
+ The filters argument is specified as a rangeset (e.g. -f0-5),
+ and the default filters value depends on the optimization level
+ set by the option -o.
+ The filter values 0, 1, 2, 3 and 4 indicate static filtering,
+ and correspond to the standard PNG filter codes (None, Left, Up,
+ Average and Paeth, respectively). The filter value 5 indicates
+ adaptive filtering, whose effect is defined by the libpng(3)
+ library used by OptiPNG.
+
+ -full Produce a full report on IDAT. This option might slow down the
+ trials.
+
+ -i type
+ Select the interlace type (0-1).
+ If the interlace type 0 is selected, the output image shall be
+ non-interlaced (i.e. progressive-scanned). If the interlace type
+ 1 is selected, the output image shall be interlaced using the
+ Adam7 method.
+ By default, the output shall have the same interlace type as the
+ input.
+
+ -nb Do not apply bit depth reduction.
+
+ -nc Do not apply color type reduction.
+
+ -np Do not apply palette reduction.
+
+ -nx Do not apply any lossless image reduction: enable the options
+ -nb, -nc and -np.
+
+ -nz Do not recode IDAT datastreams.
+ The IDAT optimization operations that do not require recoding
+ (e.g. IDAT chunk concatenation) are still performed.
+ This option has effect on PNG input files only.
+
+ -zc levels
+ Select the zlib compression levels used in IDAT compression.
+ The levels argument is specified as a rangeset (e.g. -zc6-9),
+ and the default levels value depends on the optimization level
+ set by the option -o.
+ The effect of this option is defined by the zlib(3) library used
+ by OptiPNG.
+
+ -zm levels
+ Select the zlib memory levels used in IDAT compression.
+ The levels argument is specified as a rangeset (e.g. -zm8-9),
+ and the default levels value depends on the optimization level
+ set by the option -o.
+ The effect of this option is defined by the zlib(3) library used
+ by OptiPNG.
+
+ -zs strategies
+ Select the zlib compression strategies used in IDAT compression.
+ The strategies argument is specified as a rangeset (e.g.
+ -zs0-3), and the default strategies value depends on the opti-
+ mization level set by the option -o.
+ The effect of this option is defined by the zlib(3) library used
+ by OptiPNG.
+
+ -zw size
+ Select the zlib window size (32k,16k,8k,4k,2k,1k,512,256) used
+ in IDAT compression.
+ The size argument can be specified either in bytes (e.g. 16384)
+ or kilobytes (e.g. 16k). The default size value is set to the
+ lowest window size that yields an IDAT output as big as if
+ yielded by the value 32768.
+ The effect of this option is defined by the zlib(3) library used
+ by OptiPNG.
+
+ Notes
+ Options may come in any order (except for --), before, after, or alter-
+ nating with file names. Option names are case-insensitive and may be
+ abbreviated to their shortest unique prefix.
+
+ Some options may have arguments that follow the option name, separated
+ by whitespace or the equal sign ('='). If the option argument is a num-
+ ber or a rangeset, the separator may be omitted. For example:
+
+ -out newfile.png <=> -out=newfile.png
+ -o3 <=> -o 3 <=> -o=3
+ -f0,3-5 <=> -f 0,3-5 <=> -f=0,3-5
+
+ Rangeset arguments are cumulative; e.g.
+
+ -f0 -f3-5 <=> -f0,3-5
+ -zs0 -zs1 -zs2-3 <=> -zs0,1,2,3 <=> -zs0-3
+
+EXTENDED DESCRIPTION
+ The PNG optimization algorithm consists of the following steps:
+
+ 1. Reduce the bit depth, the color type and the color palette of the
+ image. This step may reduce the size of the uncompressed image,
+ which, indirectly, may reduce the size of the compressed image
+ (i.e. the size of the output PNG file).
+
+ 2. Run a suite of compression methods and strategies and select the
+ compression parameters that yield the smallest output file.
+
+ 3. Store all IDAT contents into a single chunk, eliminating the over-
+ head incurred by repeated IDAT headers and CRCs.
+
+ 4. Set the zlib window size inside IDAT to a mininum that does not
+ affect the compression ratio, reducing the memory requirements of
+ PNG decoders.
+
+ Not all of the above steps need to be executed. The behavior depends on
+ the actual input files and user options.
+
+ Step 1 may be customized via the no-reduce options -nb, -nc, -np and
+ -nx. Step 2 may be customized via the -o option, and may be fine-tuned
+ via the options -zc, -zm, -zs and -zw. Step 3 is always executed. Step
+ 4 is executed only if a new IDAT is being created, and may be fine-
+ tuned via the option -zw.
+
+ Extremely exhaustive searches are not generally expected to yield sig-
+ nificant improvements in compression ratio, and are recommended to
+ advanced users only.
+
+EXAMPLES
+ optipng file1.png file2.gif file3.tif
+
+ optipng -o5 file1.png file2.gif file3.tif
+
+ optipng -i1 -o7 -v -full -sim experiment.png
+
+BUGS
+ Lossless image reductions are not completely implemented. (This does
+ NOT affect the integrity of the output files.) Here are the missing
+ pieces:
+
+ - The color palette reductions are implemented only partially.
+ - The bit depth reductions below 8, for grayscale images, are
+ not implemented yet.
+
+ TIFF support is limited to uncompressed, PNG-compatible (grayscale, RGB
+ and RGBA) images.
+
+ Metadata is not imported from the external image formats.
+
+ There is no support for pipes or streams.
+
+SEE ALSO
+ png(5), libpng(3), zlib(3), pngcrush(1), pngrewrite(1).
+
+STANDARDS
+ The files produced by OptiPNG are compliant with PNG-2003:
+ Glenn Randers-Pehrson et al. Portable Network Graphics (PNG) Specifi-
+ cation, Second Edition.
+ W3C Recommendation 10 November 2003; ISO/IEC IS 15948:2003 (E).
+ http://www.w3.org/TR/PNG/
+
+AUTHOR
+ OptiPNG is written and maintained by Cosmin Truta.
+
+ This manual page was originally written by Nelson A. de Oliveira for
+ the Debian Project. It was later updated by Cosmin Truta, and is now
+ part of the OptiPNG distribution.
+
+OptiPNG version 0.6.4 2010-March-14 OPTIPNG(1)
634 build/tools/optipng-0.6.4-exe/doc/png_optimization_guide.html
@@ -0,0 +1,634 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="Author" content="Cosmin Truţa">
+ <title>A guide to PNG optimization</title>
+</head>
+<body>
+
+<h2>A guide to PNG optimization</h2>
+
+<h3>1. Background</h3>
+
+<h4>1.1 The PNG file format</h4>
+
+<p>
+The <a href="http://www.libpng.org/pub/png/">Portable Network Graphics</a>
+(<b><i>PNG</i></b>) is a format for storing compressed raster graphics. The
+compression engine is based on the <b><i>Deflate</i></b> method
+[<a href="http://www.ietf.org/rfc/rfc1951">RFC1951</a>],
+designed by
+<a href="http://www.pkware.com/">PKWare</a>
+and originally used in <b>PKZIP</b>.
+</p>
+
+<p>
+The PNG format is defined by the
+<a href="http://www.libpng.org/pub/png/spec/">PNG Specification</a>.
+This specification was developed by an ad-hoc group named the
+<a href="http://www.libpng.org/pub/png/">PNG Development Group</a>, and it is
+both an International Standard (published under the formal name
+ISO/IEC&nbsp;15948) and a W3C Recommendation.
+</p>
+
+<p>
+PNG was initially intended as a superior, patent-free replacement of GIF. The
+final outcome is a modern, extensible, reliable image format, capable to handle
+an impressive number of image types (from 1-bit black-and-white images up to
+48-bit RGB images with a full 16-bit alpha channel), and geared by a
+significantly stronger lossless compression engine (typically 5-25% better than
+GIF).
+</p>
+
+<p>
+Unlike other lossless compression schemes, PNG compression does not depend
+solely on the statistics of the input, but it may vary within wide limits,
+depending on the compressor's implementation. A good PNG encoder must be
+able to take informed decisions about the factors that affect the size of the
+output. The purpose of this article is to provide information about these
+factors, and to give advice on implementing efficient PNG encoders.
+</p>
+
+
+<h4>1.2 The PNG compression</h4>
+
+<p>
+The PNG compression works in a pipeline manner.
+</p>
+
+<p>
+In the first stage, the image pixels are passed through a lossless arithmetic
+transformation named <b><i>delta filtering</i></b>, or simply
+<b><i>filtering</i></b>, and sent further as a (filtered) byte sequence.
+Filtering does not compress or otherwise reduce the size of the data, but it
+makes the data more compressible.
+</p>
+
+<p>
+In the second stage, the filtered byte sequence is passed through the
+Ziv-Lempel algorithm (LZ77), producing LZ77 codes that are further compressed
+by the Huffman algorithm in the third and final stage. The combination of the
+last two stages is referred to as the <b><i>Deflate compression</i></b>, a
+widely-used, patent-free algorithm for universal, lossless data compression.
+The maximum size of the LZ77 sliding window in Deflate is 32768 bytes, and the
+LZ77 matches can be between 3 and 258 bytes long.
+</p>
+
+<p>
+A complete description of the PNG compression is beyond the scope of this
+guide. The PNG Specification describes the format completely, and provides
+a complete list of references to the underlying technologies.
+</p>
+
+
+<h3>2. Factors that affect the PNG file size</h3>
+
+<div>
+Like any other compression scheme, PNG compression depends on the statistics
+of the input data. In addition, it depends on the following PNG-specific
+parameters:
+</div>
+<ol>
+<li>
+ The PNG image type
+</li>
+<li>
+ The PNG delta filters
+</li>
+<li>
+ The strategy of searching LZ77 matches
+</li>
+<li>
+ The size of the Huffman buffers inside the Deflate encoder
+</li>
+</ol>
+
+<p>
+Depending on how these parameters are chosen by the implementation, PNG
+compression may vary within wide limits. The process of selecting the best
+configuration is computationally infeasible, but heuristics to select a
+satisfactory configuration are available. The problem of improving these
+heuristics constitutes an interesting subject for research.
+</p>
+
+
+<h4>2.1 The PNG image type</h4>
+
+<p>
+The type of a PNG image is defined in the <b><code>IHDR</code></b> image
+header. The image has a certain bit depth, up to 16 bits per sample, and a
+certain color type, from Grayscale to RGB+Alpha. If two PNG files of different
+types represent exactly the same image, each file can be regarded as a lossless
+transformation of the other. A lossless transformation can reduce the
+<i>uncompressed</i> stream, and such a transformation is named <b><i>image
+reduction</i></b>. In most cases, image reductions are capable of reducing the
+<i>compressed</i> stream (which is, in fact, our interest), as an indirect
+effect of reducing the size of the compressor's input.
+</p>
+
+<div>
+The possible image reductions are:
+</div>
+<ul>
+<li>
+ <i>Bit depth reduction</i>
+ <br>
+ The bit depth can be reduced to a minimum value that is acceptable for all
+ samples. For example, if all sample values in a 16-bit image have the form
+ (256+1)*<i>n</i>, (e.g. #0000, #2323, #FFFF), then the bit depth can be
+ reduced to 8, and the new sample values will become <i>n</i>, (e.g. #00, #23,
+ #FF).
+</li>
+<li>
+ <i>Color type reduction</i>
+ <br>
+ - If an RGB image has 256 distinct colors or less, it can be reencoded as a
+ Palette image.
+ <br>
+ - If an RGB or Palette image has only gray pixels, it can be reencoded as
+ Grayscale.
+ <br>
+ A color type reduction can also enable a bit depth reduction.
+</li>
+<li>
+ <i>Color palette reduction</i>
+ <br>
+ If the color palette contains redundant entries (i.e. duplicate entries that
+ indicate the same RGB value) or sterile entries (i.e. entries that do not
+ have a correspondent in the raw pixel data), these entries can be removed.
+ <br>
+ A color palette reduction can also enable a bit depth reduction.
+</li>
+<li>
+ <i>Alpha channel reduction</i>
+ <br>
+ If all pixels in a Grayscale+Alpha or an RGB+Alpha image are fully opaque
+ (i.e. all alpha components are equal to 2^<sup>bitdepth</sup>-1), or if the
+ transparency information can be stored entirely in a (much cheaper)
+ <b><code>tRNS</code></b> chunk, the alpha channel can be stripped.
+</li>
+</ul>
+
+<p>
+There are, however, a few cases when some image type reductions do not
+necessarily lead to the reduction of the compressed stream. The
+<a href="http://www.cs.toronto.edu/~cosmin/pngtech/">PNG-Tech</a> site contains
+experimental analyses of these possibilities; for example, see the article
+<a href="8bpp.html">8 bits per pixel in paletted images</a>.
+</p>
+
+<p>
+Interlacing, useful for a faster, progressive rendering, is another component
+of the PNG image type that affects compression. In an interlaced stream, the
+samples corresponding to neighboring pixels are stored far away, hence the data
+in it is less correlated and less compressible. Unlike JPEG, where interlacing
+may improve the compression slightly, the PNG interlacing degrades the
+compression significantly.
+</p>
+
+
+<h4>2.2 The PNG delta filters</h4>
+
+<p>
+The role of filtering can be illustrated in the following example. Assume the
+sequence 2, 3, 4, 5, 6, 7, 8, 9. Although it has much redundancy, the sequence
+is not compressible by a Ziv-Lempel compressor, nor by a Huffman compressor.
+However, if one makes a simple and reversible transformation, replacing each
+value with the numerical difference between it and the value to its left, the
+sequence becomes 2, 1, 1, 1, 1, 1, 1, 1, which is highly compressible.
+</p>
+
+<p>
+The PNG format employs five types of filters: <b><i>None</i></b>,
+<b><i>Left</i></b>, <b><i>Up</i></b>, <b><i>Average</i></b>, and
+<b><i>Paeth</i></b>. The first filter leaves the original data intact, and the
+other four are subtracting from each pixel a value that involves the
+neighbor pixels from the left, up, and/or the upper left.
+</p>
+
+<p>
+A certain filter is assigned to each row, and is applied to all pixels from
+that row. Therefore, an image can be delta-filtered in a huge number of
+possible configurations (5 ^ <sup><i>height</i></sup>), and each configuration
+leads to a different compressed output. Two different filter configurations may
+make a difference in the compressed file size by a couple of factors, so a
+careful choice of filters is of paramount importance.
+</p>
+
+<p>
+It is possible to apply a single filter to all rows, or to apply different
+filters to different rows. In the former case, the filtering process is
+<b><i>fixed</i></b>; in the latter, it is <b><i>adaptive</i></b>.
+</p>
+
+<div>
+While an exhaustive search is unfeasible, the PNG Specification suggests a
+heuristic filtering strategy:
+</div>
+<ul>
+<li>
+ If the image type is Palette, or the bit depth is smaller than 8, then
+ do not filter the image (i.e. use fixed filtering, with the filter
+ <i>None</i>).
+</li>
+<li>
+ (The other case) If the image type is Grayscale or RGB (with or without
+ Alpha), and the bit depth is not smaller than 8, then use adaptive filtering
+ as follows: <i>independently for each row</i>, apply all five filters and
+ select the filter that produces the smallest sum of absolute values per row.
+</li>
+</ul>
+
+<p>
+Cases where the above heuristics are less than optimal are shown on the
+<a href="http://www.cs.toronto.edu/~cosmin/pngtech/">PNG-Tech</a>
+site; for example, see
+<a href="better-filtering.html">Brute-force vs. heuristic filtering</a>.
+</p>
+
+
+<h4>2.3 The strategy of searching LZ77 matches</h4>
+
+<p>
+The Ziv-Lempel algorithm works under the assumption that contiguous sequences
+appear repeatedly in the input stream. If the sequence to be encoded matches
+one or more sequences already present in the sliding history window, the
+encoder sends a LZ77 pair (<i>distance</i>, <i>length</i>) that points to the
+<i>closest</i> match. In most LZ77 incarnations, including Deflate, smaller
+distance codes are encoded more concisely.
+</p>
+
+<p>
+In Deflate, in particular, the regular (non-matched) symbols, and the match
+lengths, are sent to the same Huffman coder, while the match distances are sent
+to a separate Huffman coder. If the LZ77 matches fall between the accepted
+boundaries (i.e. they are not shorter than 3 and not longer than 258), a greedy
+strategy will accept them as a replacement for the symbols to which they
+correspond.
+</p>
+
+<p>
+The greedy strategy is preferable when compressing text files, or many types of
+binary files, but it may be suboptimal when compressing filtered data, such as
+the byte strings that come from a PNG filter. Filtered data consist mostly of
+small values with a pseudo-random distribution. Therefore, in certain
+situations, it may be desirable to favor the encoding of individual symbols,
+even if matches that may replace these symbols exist.
+</p>
+
+<p>
+The
+<a href="http://www.zlib.org/">zlib Reference Library</a>
+is a reference implementation of Deflate, which is further used by the
+<a href="http://www.libpng.org/pub/png/libpng.html">PNG Reference Library</a>.
+By default, <b>zlib</b> selects the greedy strategy, but the user is able to
+specify his or her custom preference via the <code>strategy</code> parameter.
+This parameter can take one of the following values:
+<br>
+- <code>Z_DEFAULT_STRATEGY = 0</code>, the default greedy search strategy.
+<br>
+- <code>Z_FILTERED = 1</code>, a strategy in which the matches are accepted
+only if their length is 6 or bigger.
+<br>
+- <code>Z_HUFFMAN_ONLY = 2</code>, a fast strategy in which the Ziv-Lempel
+algorithm is entirely bypassed, and all the symbols from the input are encoded
+directly by the Huffman coder.
+<br>
+- <code>Z_RLE = 3</code> (appeared in the <b>zlib-1.2.x</b> series), a fast
+strategy in which the LZ77 algorithm is essentially reduced to the Run-Length
+Encoding algorithm. In other words, the matches are accepted only if their
+distance is 1. For example, the 10-symbol sequence "<code>aaaaaaaaaa</code>"
+can be LZ77-encoded as
+['<code>a</code>', (<i>distance</i>=1, <i>length</i>=9)];
+by removing <i>distance</i>=1 from the picture, this encoding can be regarded
+as a peculiar run-length encoding (which differs from the classic RLE by using
+<i>length</i>=9 instead of <i>count</i>=10).
+<br>
+The <code>strategy</code> parameter affects only the compression ratio. It does
+not affect the correctness of the compressed output, even if it is set to an
+inappropriate value.
+</p>
+
+<p>
+It was experimentally observed that the LZ77 search is occasionally capable of