Do not disable auto contrast if display_range = 255#163
Merged
Conversation
auto_contrast if self.display_range != 255.0auto_contrast if self.display_range != 255
auto_contrast if self.display_range != 255self.display_range != 255
self.display_range != 255display_range != 255
display_range != 255display_range = 255
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some time, the Instamatic videoframe display (previously
VideoStreamFrame.on_frame, currentlyVideoStreamProcessor.image) did not run auto-scaling wheneverdisplay_rangewas set to 255. The reasoning behind this decision was likely that in such case, the maximum on observed image is 255 and therefore it does not require additional scaling. This thinking is, however, flawed, because you might have an image with 255 range that has lower (or higher, in case of odd behavior) max intensity, and you still need to scale it. This behavior therefore, although intended, behaved as a very odd bug.Here I remove this condition. With this PR in place, whenever the "autoscaling" is turned on, the image will be always scaled. If the user wants to save on computational power, they can always turn off autoscaling altogether.
Since I consider this to be a simple bug, I will merge that immediately. At best, this change will fix odd behavior for any system that uses 255 scale by default. At worst, it will make image display marginally slower (~53 ms -> ~53.5 ms) for the same users that do not see strange behavior.