Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add curve filter for applying RGB curves. #353

Merged
merged 1 commit into from Feb 20, 2015

Conversation

gockxml
Copy link
Contributor

@gockxml gockxml commented Sep 26, 2014

Usage

/filters:curve(<curve of all channels>, <curve of R>, <curve o f G>, <curve of B>)

Format of each curve

[(x1,y1),(x2,y2),...]

Examples of use

Original image

image

Demo 1

/filters:curve([(0,0),(40,59),(255,255)],[(32,59),(64,80),(92,111),(128,153),(140,169),(164,201),(192,214),(224,215),(240,214),(255,212)],[(34,41),(64,51),(92,76),(128,112),(140,124),(164,147),(192,180),(224,216),(240,236),(255,255)],[(40,46),(64,55),(92,83),(128,127),(140,144),(164,174),(192,197),(224,199),(240,197),(255,198)])/

image

Demo 2

/filters:curve([(0,0),(255,255)],[(0,50),(16,51),(32,69),(58,85),(92,120),(128,170),(140,186),(167,225),(192,245),(225,255),(244,255),(255,254)],[(0,0),(16,2),(32,18),(64,59),(92,116),(128,182),(167,211),(192,227),(224,240),(244,247),(255,252)],[(0,48),(16,50),(62,77),(92,110),(128,144),(140,153),(167,180),(192,192),(224,217),(244,225),(255,225)])/

image

@heynemann
Copy link
Member

Wow! Very good job! I'll try to have a look at it tomorrow. Maybe @cezarsa can help with reviewing this PR! Thanks a lot for the contribution.

@heynemann
Copy link
Member

Do you think you can add some tests for this filter? I'd love to merge it already. Sorry for the long delay.

If you need a sample of filter tests:
https://github.com/thumbor/thumbor/blob/master/vows/rotate_filter_vows.py

@gockxml
Copy link
Contributor Author

gockxml commented Oct 31, 2014

I thought about it, but find it is difficult to do that. The existed filter tests are all about metadata such as rotation, format or file size. Once it is about actual pixels, there seems no good way to test, such as brightness, contrast or watermark. That is the exact situation of this RGB curve filter.

@heynemann
Copy link
Member

Sorry @gockxml, I was about to merge your PR, but github says I can't merge until it's rebased. Can you do it? Thanks!

@gockxml
Copy link
Contributor Author

gockxml commented Jan 5, 2015

No problem. Rebased.

@@ -267,6 +267,7 @@
'thumbor.filters.no_upscale',
'thumbor.filters.saturation',
'thumbor.filters.max_age',
'thumbor.filters.curve'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random guy here, I think there should be a trailing comma here so future changes won't cause a diff on this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. Thank you!

@heynemann
Copy link
Member

Sorry but when applying this PR, the build fails due to a test that verifies all the default filters. Can you fix it? The log for the test failure is here:

https://api.travis-ci.org/jobs/46025767/log.txt?deansi=true

And the travis build is here:

https://travis-ci.org/thumbor/thumbor/builds/46025766

Thanks!!!

@gockxml
Copy link
Contributor Author

gockxml commented Jan 9, 2015

@heynemann thank you very much for showing me the complete log. For some weird reason, I couldn't see the whole. I thought the building failure occurred during environment setup. Sorry for my clumsy.

heynemann added a commit that referenced this pull request Feb 20, 2015
Add curve filter for applying RGB curves.
@heynemann heynemann merged commit 1d31017 into thumbor:master Feb 20, 2015
@heynemann
Copy link
Member

Thanks a LOT for your contribution.

@heynemann
Copy link
Member

Hey @gockxml

Can you please create a wiki page for this plug-in?

Thanks! We'll release a version now!

@gockxml
Copy link
Contributor Author

gockxml commented Feb 21, 2015

Added at https://github.com/thumbor/thumbor/wiki/Filters. Thank you!

@heynemann
Copy link
Member

Brilliant!

christianjgreen pushed a commit to fanhero/thumbor that referenced this pull request Aug 29, 2017
Add curve filter for applying RGB curves.
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.

None yet

3 participants