Extensions: Blurry resized images

Created on 3 Nov 2019  路  3Comments  路  Source: firebase/extensions

Extension name: storage-resize-images
Problem: When resizing images the output image is blurry

According to https://imagemagick.org/Usage/resize/#resize_unsharp
there needs to be a call to "-unsharp 0x6+0.5+0" in order to resolve this issue.

The issue is in index.ts line 175

Thanks

in-review bug

All 3 comments

Adding -unsharp 0x6+0.5+0 should be a really simple change. We'd modify this line: https://github.com/firebase/extensions/blob/506f56b6a98b4197dd8799e46b16ccb8ca4c564d/storage-resize-images/functions/src/index.ts#L175

To add the unsharp option:

await spawn("convert", [originalFile, "-resize", `${size}>`, "-unsharp", "0x6+0.5+0", resizedFile], {

However, picking the correct params for sharpening is more of an art than a science. The imagemagick docs linked above suggested multiple different unsharp configs besides 0x6+0.5+0 for different scenarios. This forum post shows how involved this discussion can be.

Might be worth considering #124 as part of this

Hi Tako,

Thanks so much for the feedback! After reviewing with the team, we realized that ImageMagick is pretty involved and would change the scope of this extension significantly. We're going to hold off on making this change and instead consider building a new extension for ImageMagick. I'll close this for now and track that effort internally.

Thanks again for using extensions!
Kara

Was this page helpful?
0 / 5 - 0 ratings