kra-mo / sly

Friendly image editor
https://sly.kramo.page
GNU General Public License v3.0
122 stars 2 forks source link

Rescaling images #34

Open MasinAD opened 1 month ago

MasinAD commented 1 month ago

The only image operation I currently miss in Sly is rescaling of images. If I have a photo from a camera it's obscenely large and I would like downscale it. Or is the option there and I cannot find it? I'd have expected it in the vicinity of the crop tool.

kra-mo commented 1 month ago

What exactly is your use case for this? For sharing to social media? Personal use?

To me, it would make sense to have an option to export as lower resolution, but do you need a specific resolution? Would you crop to that or just downscale?

MasinAD commented 1 month ago

Well, almost re sharing to social media. Do you know those web services that allow to set a profile picture but impose some unreasonable constraints on size or resolution? I'd like to avoid to resort to other applications for that.

grafik

Yeah, 128MB are excessive, I know. But I encountered other services that didn't allow more than 250 kB or resolutions like 256×256.

Case in point: phpBB, Arch Linux forum

grafik

Cropping to a resolution wouldn't really help. Say, I have a selfie of me at 4000×3000. There's no way I could crop that to get a decent profile picture.

Exporting to a lower resolution would surely work for me. I'm not entirely sure if the option wouldn't be too hidden there.

Resizing should always be done by the consuming application, IMHO, but that's simply not the reality we're living in. So, having a one-stop application to crop, rotate, resize would be really nice, especially because Sly seems to be the kind of app I could pre-install on my users' machines and recommend for their simple image editing needs.

LukaszH77 commented 3 weeks ago

I came to ask for the ability to resize photos and since it's already there, I'll just add my explanation.

In most cases, when I share photos on Mastodon and Pixelfed, I do it on long bike trips, often to places where there is poor internet access (e.g. forests and rural areas) which causes problems with uploading photos because they are too big and take too long. Being able to quickly resize a photo, maybe with a few presets (like 1024x768, 1280x960, 1600x1200) would make my life a lot easier.

kra-mo commented 3 weeks ago

What I'm gathering from this is that the exact resolution wouldn't matter and a simple low resolution option would be enough in the export tab, right? I'm planning to revamp that with more settings either way.

nekohayo commented 3 weeks ago

You probably don't have to limit yourself to minuscule resolutions either; if you use a modern JPEG encoder like MozJPEG instead of lib JPEG turbo (or whatever the apps typically use by default), you can get much smaller filesizes at quality 75, with extremely fast encoding times. Squoosh.app is a great showcase for it. Typically, at 1500px width/height max and Q75, MozJPEG will give you nice results below 150-200 kilobytes each, and at 1000px sizes you'd get between 50-80 kilobytes. In my experience, the worst rural 3G I got with thousands of villagers on a single cell tower gave me around 4 kilobytes per second during daytime (and 400 KB/s in the night), but that was an extreme case, and even then I think you'd be able to upload sub-100 KB images without problems.

Of course MozJPEG is a stopgap until JPEG XL finally makes it into Chrome and Firefox someday so that #7 can be the ultimate solution, but at least MozJPEG is a good way to not require sacrificing resolution too much in the meantime, IMHO.

VinnyStalck commented 2 weeks ago

For me, a resize/rescale where you pick a size would be perfect. I always end up having to resize images to specifics like 512x or 1024x squares.

I would say to not even bother having multiple types of interpolation.

image