this post was submitted on 25 Oct 2024
24 points (96.2% liked)

Lemmy

12613 readers
3 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

Basically title. I can't send anything without compressing it a lot (to like 256 colors).

top 11 comments
sorted by: hot top controversial new old
[–] [email protected] 42 points 2 months ago* (last edited 2 months ago)

It doesn't.

The limit is set by the people hosting your specific instance, as they're the ones who then have to host that image.

Different instances have different limits.

You can use other image hosts, tho, as long as they give you a direct image link. Just plop it into the url field/use it in a markdown image, instead of uploading to lemmy.

[–] [email protected] 20 points 2 months ago (1 children)

Storage isn't unlimited. You gonna pay for it?

[–] [email protected] 0 points 1 month ago* (last edited 1 month ago)

That would be understandable but they are capping it to less than 1 MB that is very low

[–] [email protected] 13 points 2 months ago* (last edited 2 months ago) (1 children)

You can make nearly all images small enough to upload and still look good without dropping colour depth. There are 3 ways to achieve it basically:

  • Resize it to a lower resolution (1280 x whatever looks just fine on a screen)
  • Reduce the quality
  • Change to lossy (JPG) from non-lossy (PNG)

The resizing is usually enough.

The quality reduction is something that google pagespeed focuses on too. For most apps that means choosing a lower "quality" when converting to jpg or saving as a new jpg. 85% of original is good.

If you happen to have imagemagick installed, I have a little script that I use called "resize_to_pagespeed.sh". The jist of it is this:

convert inputfile.jpg -filter Lanczos -resize 1280x1280 -sampling-factor 4:2:0 -strip -quality 85 outputfile.jpg

I just ran this on a 2.4MB photo (below) and it came out at 186KB. That's a 13x reduction. Right click -> open in new tab to see it full size.

If the image isn't square, imagemagick is smart enough to figure out correct dimensions.

[–] [email protected] 2 points 2 months ago

photos will never be pngs unless someone intentionally converts them to that format, as pngs are much worse than jpgs for storing this type of image. pngs are much better for computer generated images, such as screenshots, drawings, etc. you can also losslessly compress pngs with tools like pngcrush without converting them to jpg.

[–] [email protected] 9 points 2 months ago

It's instance dependent.

[–] [email protected] 8 points 2 months ago

Your admins define the size limit.

[–] [email protected] 7 points 2 months ago

.ml is running the beta branch that actually started to apply image size limits to thumbnails, your app is probably using the thumbnail URL instead of the main URL and thus getting the compressed image.

[–] [email protected] 6 points 2 months ago* (last edited 2 months ago)

What kind of image is it? Reducing the number of colors in a PNG is usually inferior to JPEG compression. It can be OK for screenshots of texts and simple drawing but otherwise you're better off with lossy JPEG or WebP.

Some instance admins don't even use the built-in pict-rs server so media cannot be uploaded natively at all.

Some only allow month-old accounts to post images up to 500 kiB.

Others leave the limits on the relatively high defaults: 10 MiB per file and up to 900 frames for soundless animation/video, which must be in WebM format and VP9 codec (or it will need to be reencoded, which usually fails because of the short timeout). It's easy to use ffmpeg or HandBrake to create low-bitrate 30-second HD videos that fit but the limits are not visible to users and even the defaults are nowhere to be found in Lemmy documentation, I had to read the source code.

[–] [email protected] 3 points 2 months ago
[–] [email protected] 1 points 2 months ago

Img hosting is xpensive i'd guess