<p>I agree with Brad's comment, this is very similar to those two other threads.</p>

<p>That being said, here is an <a href="https://craftcms.stackexchange.com/a/1452/45">important quote</a> which is buried on one of those threads...</p>

<blockquote>
  <p>When an image is first uploaded, Craft will "sanitize" the image for any malicious code by re-saving the image out to a new file. It jumps through some pretty significant to ensure that the sanitized image is as close to possible as the originally uploaded image in both quality and file size, which usually explains the differences people see in file sizes.</p>
</blockquote>

<p>I believe this is what the OP is experiencing.</p>

CC BY-SA 3.0
2016-09-14T15:51:41.673Z
Hey Lindsey, is this suggesting that any optimization done for the web (in the case of our PNGs) will be overwritten—or rewritten—when Craft re-saves an image before it's added onto the server? I might be missing the finesse points here. That said, if that is the case, what's the move to optimize PNGs for better web use?
CFA
CC BY-SA 3.0
2016-09-14T17:01:16.593Z
@Chris: Yes, Craft will likely undo your optimizations during the sanitization process. However, you can circumvent this by uploading files via FTP, and then "Update Asset Indexes".
Lindsey D
CC BY-SA 3.0
2016-09-14T17:03:46.123Z
@Chris: You may also find one of these plugins helpful... [Imager](https://github.com/aelvan/Imager-Craft), or [Tiny Image](https://craftpl.us/plugins/tiny-image). They are both capable of optimizing your images _after_ they've been uploaded.
Lindsey D
CC BY-SA 3.0
2016-09-22T19:19:35.057Z
Thanks Lindsey, we'll take a peek! Appreciate your thoughts here.
CFA
CC BY-SA 3.0
2016-09-14T03:42:01.557Z
2016-09-14T03:42:01.557Z
2017-04-13T12:51:00.303Z
Lindsey D
<p>We've got quite a few PNG image files for a site build, so naturally we're running them through tinypng to reduce size. This works great locally, but when we upload them to assets (S3) the file size is getting huge again.</p>

<p>Pic: <a href="https://cl.ly/152u2C2D3g2n" rel="nofollow">https://cl.ly/152u2C2D3g2n</a></p>

<p>193kb to 440kb in this example ^ which is typical.</p>

<p>Any thoughts?</p>

CC BY-SA 3.0
2016-09-14T03:02:33.760Z
Similar? https://craftcms.stackexchange.com/questions/1445/using-image-transforms-sometimes-results-in-bloated-file-sizes and https://craftcms.stackexchange.com/questions/12398/images-much-larger-on-server-and-page-than-the-local-version
Brad Bell
CC BY-SA 3.0
2016-09-14T15:48:42.093Z
In this case, it isn't happening after an image transform. We're taking images from our local machines, dragging them into Assets, they upload into S3, and on their arrival into S3, are larger in size than what's on our machine. And not by a few KB, in some cases 200+ KB larger.
CFA
<assets><s3>
Why are PNG images bigger in file size on the (S3) server?
# Why are PNG images bigger in file size on the (S3) server?

(Asked by: username_0 on 2016-09-13)

We've got quite a few PNG image files for a site build, so naturally we're running them through tinypng to reduce size. This works great locally, but when we upload them to assets (S3) the file size is getting huge again.

Pic: <https://cl.ly/152u2C2D3g2n>

193kb to 440kb in this example ^ which is typical.

Any thoughts?

**Tags:** assets, s3
> **Comments:**
> **username_1**: Similar? https://craftcms.stackexchange.com/questions/1445/using-image-transforms-sometimes-results-in-bloated-file-sizes and https://craftcms.stackexchange.com/questions/12398/images-much-larger-on-server-and-page-than-the-local-version  
> **username_0**: In this case, it isn't happening after an image transform. We're taking images from our local machines, dragging them into Assets, they upload into S3, and on their arrival into S3, are larger in size than what's on our machine. And not by a few KB, in some cases 200+ KB larger.  

---

## 1 answers

### Answer by username_2 on 2016-09-14. Score: 4

I agree with Brad's comment, this is very similar to those two other threads.

That being said, here is an [important quote](https://craftcms.stackexchange.com/a/1452/45) which is buried on one of those threads...

> When an image is first uploaded, Craft will "sanitize" the image for any malicious code by re-saving the image out to a new file. It jumps through some pretty significant to ensure that the sanitized image is as close to possible as the originally uploaded image in both quality and file size, which usually explains the differences people see in file sizes.

I believe this is what the OP is experiencing.

> **Comments:**
> **username_0**: Hey Lindsey, is this suggesting that any optimization done for the web (in the case of our PNGs) will be overwritten—or rewritten—when Craft re-saves an image before it's added onto the server? I might be missing the finesse points here. That said, if that is the case, what's the move to optimize PNGs for better web use?  
> **username_2**: @Chris: Yes, Craft will likely undo your optimizations during the sanitization process. However, you can circumvent this by uploading files via FTP, and then "Update Asset Indexes".  
> **username_2**: @Chris: You may also find one of these plugins helpful... [Imager](https://github.com/aelvan/Imager-Craft), or [Tiny Image](https://craftpl.us/plugins/tiny-image). They are both capable of optimizing your images _after_ they've been uploaded.  
> **username_0**: Thanks Lindsey, we'll take a peek! Appreciate your thoughts here.  

---

