Joan León PRO
⚡️ Web Performance Consultant | Speaker | Staff Frontend Engineer at @AdevintaSpain | @GoogleDevExpert in #WebPerf | @cloudinary Ambassador
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
Command
Input
Output
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
Command
Input
Output
Folders
#AdevintaMeetups
Joan
León
@nucliweb
Folders
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
5.1.0
1.3.2
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
imagemin-cli
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
svgo
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating...
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updated
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
const imagemin = require("imagemin");
const imageminMozjpeg = require("imagemin-mozjpeg");
const imageminPngquant = require("imagemin-pngquant");
const imageminSVGO = require("imagemin-svgo");
(async () => {
const files = await imagemin(
["./originals/{*.jpg,*.png,*.svg}"],
{
destination: "./images",
plugins: [
imageminMozjpeg({ quality: 80 }),
imageminPngquant({
strip: true,
quality: [0.75, 0.8]
}),
imageminSVGO({
removeViewBox: false,
removeDimensions: true
})
]
});
console.log("All images optimized!");
console.log("You are rock! 🤘🏼");
})();
#AdevintaMeetups
Joan
León
@nucliweb
Compressors
Updating
Like a crafter
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Originals
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Originals
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Originals
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Density
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Density
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Density
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Documentation
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Documentation
#AdevintaMeetups
Joan
León
@nucliweb
Guidelines
Documentation
#AdevintaMeetups
The Structural Similarity
Herramientas para medir las diferencias percibidas entre imágenes
Joan
León
@nucliweb
Diffing
#AdevintaMeetups
Joan
León
@nucliweb
Diffing
SSIM
#AdevintaMeetups
Joan
León
@nucliweb
Diffing
SSIM
#AdevintaMeetups
Joan
León
@nucliweb
Image Garbage Colector
#AdevintaMeetups
Joan
León
@nucliweb
Backlog
#AdevintaMeetups
Joan
León
@nucliweb
Yes, we have monolith too 🤪
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
Joan
León
@nucliweb
#AdevintaMeetups
#AdevintaMeetups
By Joan León
En muchos proyectos, tenemos una series de recursos que no son dinámicos: imágenes, vídeos, iconos, tipografías o textos i18n. Las imágenes suelen ser las menos cuidadas, desde el punto de vista de la performance. Y lo sé de primera mano, así que os quiero contar cómo pasamos de una carpeta images desplegada en un S3, a un repositorio con unas guidelines de la estructura, naming, automatización de compresión de imágenes y generación de “Responsive Images”, test de regresión visual e incluso un garbage images collector, para hacer limpieza de esas imágenes que quedan en el olvido.