Gifski icon indicating copy to clipboard operation
Gifski copied to clipboard

Display estimate as a range

Open kornelski opened this issue 5 years ago • 5 comments

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.

kornelski avatar Sep 06 '19 12:09 kornelski

with different assumptions (fudge factors).

What would the different assumptions be?

sindresorhus avatar Sep 06 '19 12:09 sindresorhus

Magic constants for compression ratio and influence of quality. They are typical/guessed fudge factors, so it's valid to vary them.

kornelski avatar Sep 07 '19 01:09 kornelski

Any kind of improved accuracy for expectations is good, I think.

estimated actual

jsejcksn avatar Feb 15 '20 11:02 jsejcksn

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.

sindresorhus avatar Oct 24 '20 14:10 sindresorhus

		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.

kornelski avatar Oct 24 '20 14:10 kornelski