Skip to content

Support resize with a target file/stream size, rather than dimensions #1305

Discussion options

You must be logged in to vote

I'm afraid that cannot be done; there's simply too many variables.

Operations on images are performed on the uncompressed pixels laid out in memory. An encoded image is subject to the compression rules and constraints of the individual format.

Say I resize two separate images to a given set of dimensions and encode them using the same image format and options. Unless those two images were identical you will result in two output images of different file size.

You'd have to brute force, rinsing and repeating the resize + encoding operation over and over again. It's not efficient.

Perhaps someone could build something nifty with machine learning that could make a best guess after training bu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@antonfirsov
Comment options

Answer selected by JimBobSquarePants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants