
Now I understand. Thank you!
I would suggest the following instead: Convert to LAB Perform transform on lightness channel Convert back to RGB
Sounds good. Do you have a paper or any reliable source about this? Just interested in this... Johannes Schönberger Am 17.10.2012 um 02:41 schrieb Stéfan van der Walt <stefan@sun.ac.za>:
On Tue, Oct 16, 2012 at 4:59 PM, Steven Silvester <steven.silvester@gmail.com> wrote:
I would suggest the following instead: Convert to LAB Perform transform on lightness channel Convert back to RGB
That seems like a sound approach to me. Tony, Andreas?
Because, red, green, and blue are not really independent "channels" to the human eye. I used this method on the adapthist pull request when handling RGB images.
By the way, thanks for that PR--now that 0.7.2 is out the door, I reviewed it.
Stéfan
--

On Wed, Oct 17, 2012 at 7:39 AM, Schönberger Johannes <hannesschoenberger@gmail.com> wrote:
Sounds good. Do you have a paper or any reliable source about this? Just interested in this...
The question is, should we make this a decorator, or simply provide it as utility functions? I'm wondering, because now we already have two different ways of handling color images: split them up, RGB, or convert them to LAB and apply the filter to LAB. How do we expose both of these sensible alternatives to the user? We can have a *default*, so that all single-channel filters are done on the luminance layer, but then combine that with utility functions. E.g. @luminance_filter def gray_filter(image, ...): ... gray_filter(color_image, params) --> convert to LAB, filter on L, convert back filter_layers(color_image, gray_filter, params) -> filter each layer separately and combine Alternatively, skip the decorators completely, and just provide two utility functions: filter_layers and filter_luminance. Let's hear what the API artists have to say :) Cheers Stéfan
participants (2)
-
Schönberger Johannes
-
Stéfan van der Walt