# Jpeg Image Quality

**URL:** <https://zola.discourse.group/t/jpeg-image-quality/1227>\
**Category:** Support\
**Created:** [March 8, 2022, 2:09pm UTC](https://zola.discourse.group/t/jpeg-image-quality/1227 "2022-03-08T14:09:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anyhow](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anyhow](https://zola.discourse.group/u/anyhow)\
**Post date:** [March 8, 2022, 2:09pm UTC](https://zola.discourse.group/t/jpeg-image-quality/1227/1 "2022-03-08T14:09:09Z")

</div>

Hi!  
I’m experiencing bad image quality and big file sizes when using the resize\_image() function.  
Input image is a 1920px-width Jpeg with ~300kb and it becomes ~700kb and introduces bending.  
Qualityloss becomes worse when scaled down even more.

This is the code I used:  
`resize_image(path=asset, width=1920, op="fit_width", format="jpg", quality=100)`

Left: Original, Right: Processed.

 ![Bildschirmfoto vom 2022-03-08 14-23-19](https://global.discourse-cdn.com/free1/uploads/zola1/original/1X/352dcf13518b1944aa4d7ab1aabcdf899b002ca6.jpeg)

Am I doing something wrong?  
Thanks.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [March 9, 2022, 9:38am UTC](https://zola.discourse.group/t/jpeg-image-quality/1227/2 "2022-03-09T09:38:48Z")

</div>

What are you trying to do with that resize call? You’re setting the width to be the same as the input so it’s not going to really resize anything.  
As for the file size, it’s weird. We are calling to [https://crates.io/crates/image](https://crates.io/crates/image) to handle the resizing. I’m guessing with a quality of 100, it tries to add more details? Can you try quality=80?

---

<div class="post-metadata">

**Author:** ![anyhow](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anyhow](https://zola.discourse.group/u/anyhow)\
**Post date:** [March 10, 2022, 12:54am UTC](https://zola.discourse.group/t/jpeg-image-quality/1227/3 "2022-03-10T00:54:21Z")

</div>

Thanks for the inputs. I set scaling to one just to demonstrate the file size difference - I tried many variants. Every other option like scaling or setting the quality lower decreases the quality even more.  
I would expect, that at least quality 100 wouldn’t visible alter the visual quality of the pictures.

I guess it’s to blame the library then. Strange that this didn’t come up yet.  
I think if you’re working with photography, it’s not usable right now. At least for me.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [March 10, 2022, 8:38am UTC](https://zola.discourse.group/t/jpeg-image-quality/1227/4 "2022-03-10T08:38:06Z")

</div>

If you can reproduce the issue with just the `image` crate, it’s definitely worth opening an issue there, the whole code for image processing in Zola is [zola/lib.rs at master · getzola/zola · GitHub](https://github.com/getzola/zola/blob/master/components/imageproc/src/lib.rs)
