pngquant — lossy PNG compressor
pngquant is a command-line utility and a library for converting 24/32-bit PNG images to paletted (8-bit) PNGs.
The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency.
Related cards:
Fix PNG colors in IE, old Safaris and new Firefoxes
Some browsers render PNG images with color profiles and other shenanigans, some don't.
The cleanest way to have consistent colors across browsers is to [convert all your images to a standard color profile, strip the image's original profile and a...
Do not use transparent PNGs for iOS favicons
Safari on iOS accepts an apple-touch-icon
favicon that is used for stuff like deskto...
ImageMagick: Converting SVG to raster image formats like PNG or JPEG
Conversion
ImageMagick can convert SVGs to raster image formats.
Example for PNG:
convert input.svg output.png
If the SVG has a size of 24x24 (viewBox="0 0 24 24
"), the resulting PNG will also have a size of 24x24.
Resizing...
Javascript Compressor - compress code online for free
Compress and obfuscate Javascript code online completely free using this compressor.
Auto-generate state_machine graphs as PNG images
The state_machine gem comes with a rake task that lets you generate PNG graphs from any model using state_machine
.
Install the required dependencies like this:
sudo apt-get install graphviz
...
How to make your application assets cachable in Rails
Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both, but the examples shown are for Sprockets.
Every page in your application uses many assets, su...
Rails asset pipeline: Why relative paths can work in development, but break in production
The problem
When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app
:
app/assets/fonts
app/assets/images
app/assets/javascripts
app/assets/stylesheets
Wit...