Gifski
Gifski copied to clipboard
Display estimate as a range
The estimate could be displayed as a range, e.g.: 0.5MB-2MB. This could be done simply by calculating estimate twice, with different assumptions (fudge factors).
Displaying it as a range would communicate to users that it's not an actual expected file size, and would communicate how imprecise the estimate is, so they would be less surprised when it's off.
with different assumptions (fudge factors).
What would the different assumptions be?
Magic constants for compression ratio and influence of quality. They are typical/guessed fudge factors, so it's valid to vary them.
Any kind of improved accuracy for expectations is good, I think.


From https://github.com/sindresorhus/Gifski/pull/205#issuecomment-714612557:
For lower/upper guesstimate I had in mind plugging in different constants/assumptions into the algorithm.
What would those constants/assumptions be? This issue is a bit vague on how exactly it should be solved.
let frameCount = duration * frameRateSlider.doubleValue
let dimensions = resizableDimensions.changed(dimensionsType: .pixels).currentDimensions.value
var fileSize = (Double(dimensions.width) * Double(dimensions.height) * frameCount) / 3
fileSize = fileSize * (qualitySlider.doubleValue + 1.5) / 2.5
The / 3
part is a guess of compression ratio. It could be /5 and /2 for example.