107 days ago · Tech · hide · Fediverse post

Smaller images for the webTo prepare my images for my website to be smaller and progressively loaded, I had been using `imagemagick`. But my computer is now too old to properly install it with homebrew or macports, so I had to find another solution.imagemagickI found `sharp`, which is an NPM package, which I don't love, but gets the job done and is very lightweight in comparison.sharpThe big things I try and do for image processing for the web are:Lower quality to remove hyper detailSmall amount of gaussian blur to reduce file sizeInterlacing to allow progressive loading on bad connectionsRemove EXIF metadata that is not relevantWhat I did with `imagemagick` was:magick "$file" -strip -gaussian-blur 0.05 -interlace Plane -quality 25 "$output" What I'm doing with `sharp` now is:const output = await sharp(file) .rotate() .blur({ minAmplitude: .05, sigma: .5, }) .jpeg({ quality: 25, progressive: true, optimiseScans: true, force: true, }) .toBuffer(); fs.writeFileSync(outputFile, output);…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town