Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image file size changed after saving #870

Closed
baibai92 opened this issue Sep 26, 2020 · 11 comments
Closed

Image file size changed after saving #870

baibai92 opened this issue Sep 26, 2020 · 11 comments

Comments

@baibai92
Copy link

System information:

  • Windows OS version: windows 10 2004
  • ImageGlass version: 7.6.4.30

When I use the function: save image as, the saved image size has been changed. I don’t know if the others have changed.
I want the saved image to retain the same attributes as the original image, just like copying.

屏幕截图 2020-09-27 023525
On the left is saved, and the right is the original
@d2phap

@d2phap d2phap changed the title 图像另存为大小改变 Image file size changed after saving Sep 27, 2020
@d2phap
Copy link
Owner

d2phap commented Sep 27, 2020

IG is set to save the image as 100% quality by setting "quality" in Magick.NET library. In other apps (MS Paint,...) it's about 75-80%
I will add an option to change this value in the next release.
Also reported at #829

@d2phap d2phap added this to Potential tasks in 8.0 via automation Sep 27, 2020
@d2phap d2phap added this to the Issues 7.6.4.30 milestone Sep 27, 2020
@fire-eggs
Copy link
Collaborator

fire-eggs commented Sep 27, 2020

The image in question is a PNG image. Image quality "normally" doesn't apply to PNG.

When IG saves at 100% quality, the image size usually increases. The OP's image size has decreased.

We'd need to have a copy of an image which shows the problem. Did IG strip Exif or other Metadata? Change the bits-per-pixel?

@fire-eggs
Copy link
Collaborator

Before I forget (again!) - the image you show is very nice! Would you share the source? Thanks!

@baibai92
Copy link
Author

I tried different formats and different sizes of pictures, some became bigger and some became smaller. Now I provide these files, you can try。
Link:https://cowtransfer.com/s/2f99346b322449

@baibai92
Copy link
Author

@fire-eggs

@fire-eggs
Copy link
Collaborator

Thanks for the samples!

What IG needs to do is save the image using the same configuration the image was loaded with.

As Phap points out, in the case of JPEG, IG is potentially using a different quality setting. But there is more to it:

  • BMP files: Magick.NET is writing out additional metadata (Red Mask, Green Mask, etc) which increases the file size.
  • JPEG: in addition to the quality setting change, Magick.NET is writing different metadata.
  • PNG: Magick.NET is writing additional metadata, but is using a more effective encoding, making the written PNG overall smaller!

@d2phap d2phap moved this from Potential tasks to Tasks in 8.0 Nov 12, 2020
d2phap added a commit that referenced this issue Nov 18, 2020
@d2phap d2phap moved this from Tasks to In progress in 8.0 Nov 18, 2020
@d2phap
Copy link
Owner

d2phap commented Nov 18, 2020

Add option to change image quality in Settings > Edit tab in IG Moon: https://imageglass.org/moon

image

@d2phap d2phap moved this from In progress to Reviewing in 8.0 Nov 18, 2020
@d2phap d2phap closed this as completed Nov 19, 2020
8.0 automation moved this from Reviewing to Done Nov 19, 2020
@StevenLOL StevenLOL mentioned this issue Jan 4, 2021
@mirh
Copy link

mirh commented Jan 19, 2021

I cannot find that option in 8.0.12.8.

@d2phap
Copy link
Owner

d2phap commented Jan 19, 2021

@mirh
You go to Settings > Edit tab.
Or you can send me a screenshot

@mirh
Copy link

mirh commented Jan 19, 2021

Yes, I have seen your scre
Nvm I had a brainfart.

@manyfew
Copy link

manyfew commented Dec 3, 2023

I just rotated a JPEG 90° right once. The file was originally 12.2 MB, and after saving it became 18.7 MB. If I rotate it using the Windows Photos app the file size doesn't change. I wonder if this could be optimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
8.0
  
Done
Development

No branches or pull requests

5 participants