{"_id":"56328926df556c0d00cd0929","category":{"_id":"542979c51215fe08007e0ee9","project":"542979c51215fe08007e0ee5","version":"542979c51215fe08007e0ee8","__v":12,"pages":["542979c51215fe08007e0eeb","542ae00fcedcfc140004b81e","542abdb354d88d140075fbf2","542986467a6b690800767fb1","54298c241215fe08007e0ff4","54380adef1c23914006724b9","546287c18ba5620800710e4c","55e99381358d923700be988e","56328926df556c0d00cd0929","56421475b0dc090d00f8842c"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T15:24:53.471Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"version":{"_id":"542979c51215fe08007e0ee8","project":"542979c51215fe08007e0ee5","__v":4,"createdAt":"2014-09-29T15:24:53.437Z","releaseDate":"2014-09-29T15:24:53.437Z","categories":["542979c51215fe08007e0ee9","542985897a6b690800767fab","5429898d1215fe08007e0fe6","542ac5aa54d88d140075fcaf"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"542979b61215fe08007e0ee4","project":"542979c51215fe08007e0ee5","parentDoc":null,"__v":5,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-29T21:01:26.671Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Inkcite can automatically optimize all of the images in your email project before uploading to your CDN, mailing a preview or performing a compatibility test.  Inkcite uses Image Optim which runs your images through a variety of optimizers and chooses the best one - ensuring maximum compression and minimal quality loss.\n\nImage optimization is enabled by default in `config.yml`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# When true (recommended), enables automatic optimization of GIF,\\n# JPG and PNG images used in your email.\\noptimize-images: true\",\n      \"language\": \"yaml\",\n      \"name\": \"config.yml\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note!\",\n  \"body\": \"When image optimization is enabled, the source images you save in `images/` should be uncompressed or at maximum quality.\"\n}\n[/block]\nWhen image optimization is enabled, Inkcite will create compressed versions of each image and save them in `images-optim`.  The source files in `images/` are never damaged.  Inkcite automatically detects when source images are updated and re-optimizes them.\n\n# Previewing Optimized Images\n\nWhen you view your email using the live preview server (e.g. `inkcite server`) the images you see in-browser are the optimized version.\n\n# Advanced Configuration\n\nOut of the box, Inkcite performs reasonably aggressive lossy optimization of the images in your project.  If you desire more control over the quality of the images generated by Inkcite, you can do so by creating and populating an `image_optim.yml` configuration file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# If you have enabled image optimization in config.yml you can control the\\n# exact inner-workings of the process through these settings.  Additional\\n# documentation available here:\\n# https://github.com/toy/image_optim\\n\\nallow_lossy: true       # Small images through lossy compression\\nverbose: false \\t\\t\\t# Verbose output\\n\\n# Worker/optimizer-specific configurations follow\\n\\nadvpng:\\n  level: 4       \\t\\t# Compression level: 0 - don't compress, 1 - fast, \\n                    # 2 - normal, 3 - extra, 4 - extreme\\n\\ngifsicle:\\n  level: 3       \\t\\t# Compression level: 1 - light and fast, 2 - normal,\\n                    # 3 - heavy (slower)\\n  careful: false \\t\\t# Avoid bugs with some software\\n\\njpegoptim:\\n  max_quality: 50\\t\\t# Maximum image quality factor 0..100, ignored if\\n                    # allow_lossy is false\\n\\njpegrecompress:\\n  quality: 1\\t\\t\\t\\t# JPEG quality preset: 0 - low, 1 - medium, 2 - high,\\n                    # 3 - veryhigh\\n\\noptipng:\\n  level: 5\\t\\t\\t\\t# Optimization level preset: 0 - least, 7 - best\\n\\npngquant:\\n  quality: !ruby/range 0..50  # Quality min..max - don't save below min,\\n                              # use less colors below max\\n  speed: 1\\t\\t\\t\\t# Speed/quality trade-off: 1 - slow, 3 - default, \\n                  # 11 - fast & rough\\n\\n# Note: PNGOUT is free to use even in commercial soft, but you can not\\n# redistribute, repackage or reuse it without consent and agreement of\\n# its creator.\\n#\\n# Enable PNGOUT optimization by downloading and installing the binaries\\n# available from http://www.jonof.id.au/kenutils\\npngout: false\\n\\nsvgo: false\\n\",\n      \"language\": \"yaml\",\n      \"name\": \"image_optim.yml\"\n    }\n  ]\n}\n[/block]\nIf you make changes to this configuration file, Inkcite will automatically re-optimize every image in your project during the next build, CDN upload or preview rendering.","excerpt":"Smaller is better. Automatically optimize the images in your email using Image Optim.","slug":"image-optimization","type":"basic","title":"Image Optimization"}

Image Optimization

Smaller is better. Automatically optimize the images in your email using Image Optim.

Inkcite can automatically optimize all of the images in your email project before uploading to your CDN, mailing a preview or performing a compatibility test. Inkcite uses Image Optim which runs your images through a variety of optimizers and chooses the best one - ensuring maximum compression and minimal quality loss. Image optimization is enabled by default in `config.yml`: [block:code] { "codes": [ { "code": "# When true (recommended), enables automatic optimization of GIF,\n# JPG and PNG images used in your email.\noptimize-images: true", "language": "yaml", "name": "config.yml" } ] } [/block] [block:callout] { "type": "info", "title": "Note!", "body": "When image optimization is enabled, the source images you save in `images/` should be uncompressed or at maximum quality." } [/block] When image optimization is enabled, Inkcite will create compressed versions of each image and save them in `images-optim`. The source files in `images/` are never damaged. Inkcite automatically detects when source images are updated and re-optimizes them. # Previewing Optimized Images When you view your email using the live preview server (e.g. `inkcite server`) the images you see in-browser are the optimized version. # Advanced Configuration Out of the box, Inkcite performs reasonably aggressive lossy optimization of the images in your project. If you desire more control over the quality of the images generated by Inkcite, you can do so by creating and populating an `image_optim.yml` configuration file. [block:code] { "codes": [ { "code": "# If you have enabled image optimization in config.yml you can control the\n# exact inner-workings of the process through these settings. Additional\n# documentation available here:\n# https://github.com/toy/image_optim\n\nallow_lossy: true # Small images through lossy compression\nverbose: false \t\t\t# Verbose output\n\n# Worker/optimizer-specific configurations follow\n\nadvpng:\n level: 4 \t\t# Compression level: 0 - don't compress, 1 - fast, \n # 2 - normal, 3 - extra, 4 - extreme\n\ngifsicle:\n level: 3 \t\t# Compression level: 1 - light and fast, 2 - normal,\n # 3 - heavy (slower)\n careful: false \t\t# Avoid bugs with some software\n\njpegoptim:\n max_quality: 50\t\t# Maximum image quality factor 0..100, ignored if\n # allow_lossy is false\n\njpegrecompress:\n quality: 1\t\t\t\t# JPEG quality preset: 0 - low, 1 - medium, 2 - high,\n # 3 - veryhigh\n\noptipng:\n level: 5\t\t\t\t# Optimization level preset: 0 - least, 7 - best\n\npngquant:\n quality: !ruby/range 0..50 # Quality min..max - don't save below min,\n # use less colors below max\n speed: 1\t\t\t\t# Speed/quality trade-off: 1 - slow, 3 - default, \n # 11 - fast & rough\n\n# Note: PNGOUT is free to use even in commercial soft, but you can not\n# redistribute, repackage or reuse it without consent and agreement of\n# its creator.\n#\n# Enable PNGOUT optimization by downloading and installing the binaries\n# available from http://www.jonof.id.au/kenutils\npngout: false\n\nsvgo: false\n", "language": "yaml", "name": "image_optim.yml" } ] } [/block] If you make changes to this configuration file, Inkcite will automatically re-optimize every image in your project during the next build, CDN upload or preview rendering.