You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched searched open and closed issues for duplicates.
I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.
Overall summary
When sending images, Signal re-encodes them, often increasing file size significantly in the process. This is especially annoying if you have optimized the image's file size before sending it.
Steps to reproduce
Create a JPEG image with low quality settings (e.g. 20/100). My example image is 928×640 and 35 K in size. It contains very visible artifacts, but is legible.
Use the paperclip button to attach it to a message.
Select either "standard" or "high" image quality, the file size increase happens in both modes.
Send the image.
Expected result
Since it makes sense for Signal to strip metadata (e.g. location information and serial numbers) from the image, a slight variation in file size (preferably towards the lower end) can be expected.
Actual result
When I use the "download" button to save the image that has been sent, I can see that it's now 79 K in size ("standard" setting). This is more than twice the original size. Loading both images in Python's pillow library and comparing the raw image data (.tobytes(), but also with .getdata()) shows that the raw pixel data has been re-encoded, which likely also reduced the quality.
Using the "high" quality setting in Signal, the image size is changed to 80 K instead. Raw image data still differs, which implies that the image has been re-encoded, too.
For good measure, I've also performed the experiment with a PNG input (275 K originally) instead.
"Standard" mode reduces the file size to 77 K, but obviously converts the image to a JPEG in the process. (Note that, for whatever reason, this is 2 K less than what Signal made of the 35 K JPEG input.)
"High" mode results in a 345 K image, a 25 % increase.
Screenshots
Not sure whether GitHub will mangle these in some way, but these are my original input images and their SHA-256 hashes.
Forgot to mention in the original report: I saw #5469 when looking for related issues which claims that this is fixed in ≥ 5.15. Maybe it's a regression?
[signalapp#6928] Transparent Png Doesn't Work (Even With Files)
Add a failing test to show that in some cases uploading a png file results in a jpg being
produced.
[signalapp#6881] File size increase when sending images
Add a passing test that automates the example written in the issue,
where a file's size increases after uploading.
Run with:
npm run generate && npm run test-electron -- --grep="image processing"
It does add an extra devDependency, hope that's okay. It's for
inspecting jpeg images.
Using a supported version?
Overall summary
When sending images, Signal re-encodes them, often increasing file size significantly in the process. This is especially annoying if you have optimized the image's file size before sending it.
Steps to reproduce
Expected result
Since it makes sense for Signal to strip metadata (e.g. location information and serial numbers) from the image, a slight variation in file size (preferably towards the lower end) can be expected.
Actual result
When I use the "download" button to save the image that has been sent, I can see that it's now 79 K in size ("standard" setting). This is more than twice the original size. Loading both images in Python's pillow library and comparing the raw image data (
.tobytes()
, but also with.getdata()
) shows that the raw pixel data has been re-encoded, which likely also reduced the quality.Using the "high" quality setting in Signal, the image size is changed to 80 K instead. Raw image data still differs, which implies that the image has been re-encoded, too.
For good measure, I've also performed the experiment with a PNG input (275 K originally) instead.
Screenshots
Not sure whether GitHub will mangle these in some way, but these are my original input images and their SHA-256 hashes.
Signal version
7.5.1
Operating system
Debian 12 (bookworm) amd64
Version of Signal on your phone
7.7.1
Link to debug log
No response
The text was updated successfully, but these errors were encountered: