Skip to content

Optimize Brightness and Contrast node#2773

Merged
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:opt-b&c
Apr 9, 2024
Merged

Optimize Brightness and Contrast node#2773
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:opt-b&c

Conversation

@RunDevelopment
Copy link
Member

The main optimizations are:

  • Only clip when necessary
  • Reuse the image buffers of intermediate results
  • Don't multiply with 1
Configuration Before After Note
B=0 C=0 160ms 0ms Pass through is free now
B=-14 C=0 410ms 210ms
B=0 C=22 430ms 260ms
B=0 C=-38 380ms 140ms We can often save np.clip when lowering contrast

Tested on a 8468x4320 RGB image.

Details

Before:
image

After:
image

@joeyballentine joeyballentine merged commit 574399b into chaiNNer-org:main Apr 9, 2024
@RunDevelopment RunDevelopment deleted the opt-b&c branch April 9, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants