hsl

Why does greyscale work the way it does?

若如初见. 提交于 2019-12-30 01:43:29
问题 My original question I read that to convert a RGB pixel into greyscale RGB, one should use r_new = g_new = b_new = r_old * 0.3 + g_old * 0.59 + b_old * 0.11 I also read, and understand, that g has a higher weighting because the human eye is more sensitive to green. Implementing that, I saw the results were the same as I would get from setting an image to 'greyscale' in an image editor like the Gimp. Before I read this, I imagined that to convert a pixel to greyscale, one would convert it to

Why doesn't hue rotation by +180deg and -180deg yield the original color?

痞子三分冷 提交于 2019-12-28 02:50:06
问题 By reading HSL/HSV color theory, I get the impression that hue component is a cyclical attribute that repeats every 360 degrees and can be changed independently of saturation and lightness/value. Correct me if I am wrong, but these statements logically follow the previous definition: Rotating hue by 360 degrees yields the same color Rotating hue by 180 degrees twice yields the original color Rotating hue by 180 degrees followed by -180 degrees yields the original color However, only the

How to generate a HSL or HSI Histogram from a normal Image?

拜拜、爱过 提交于 2019-12-25 03:29:34
问题 I am working on a scientific work project, where i need to get some image standards. To do this, i need a code that generate 3 Histograms from a normal .JPEG .PNG OR .BMP image. The first histogram its the HUE Histogram, the second is SATURATION histogram and the third the LUMINOSITY or INTENSITY histogram. Im working with HSL and HSI, so the third histogram both LUMINOSITY or INTENSITY would be useful. I would prefer a Java or C# implementation, if theres exists one. Does anyone knows if

Testing HSL colours, ideally avoiding Red adjacent to Green (common colour-blindness type)

自古美人都是妖i 提交于 2019-12-24 08:37:11
问题 Inspired by the top answer on this page I wrote a python program to generate N distinct HEX colours. The difference is that the original author would generate saturation and luminance by using math.random(), whereas I use a trigonometric function which I can guarantee will always give a unique hue, saturation & luminance, whilst also providing the advantage that I could program yellow to appear darker than blue, allowing better contrast against white background & black text (what I need it

How can I create a color with values for green, blue, orange, and gold only?

ぃ、小莉子 提交于 2019-12-23 01:34:26
问题 If one knows the "weights" of red, green, and blue, one can create a color using a class like .blaRGB { color: rgb(128, 128, 128) } .blaHSL { color: hsl(33%, 34%, 33%) } and use it in HTML like so: <p class="blaRGB">BLA RGB</p> <p class="blaHSL">BLA HSL</p> With the values shown above, blaRGB is dingy gray and blaHSL is white. But what if one wants to represent combinations of other colors, such as green, blue, orange, and gold? Is there a way to define such colors with a notation like the

RGB to HSL, hue calculation is wrong

送分小仙女□ 提交于 2019-12-22 01:04:49
问题 I'm trying to convert a RGB32 value to HSL because I want to use the Hue component. I have used some examples that I found online to create this class: public class HSLColor { public Double Hue; public Double Saturation; public Double Luminosity; public HSLColor(Double H, Double S, Double L) { Hue = H; Saturation = S; Luminosity = L; } public static HSLColor FromRGB(Color Clr) { return FromRGB(Clr.R, Clr.G, Clr.B); } public static HSLColor FromRGB(Byte R, Byte G, Byte B) { Double _R = (R /

Faster algorithm to change Hue/Saturation/Lightness in a bitmap

这一生的挚爱 提交于 2019-12-18 18:26:11
问题 I am trying to filter a Bitmap image to increase or decrease Hue, Saturation, and Lightness values. My code is working perfectly, but it is slow . I am locking two bitmaps in memory, the original source and the current destination. The user can move various trackbar controls to modify each value which is then converted to an HSL value. For example, the values on the trackbar correspond to a range of -1.0 to 1.0. Each time an event is thrown that the trackbar value changed, I run a function

CSS Filter as a color modifier for one image

我的梦境 提交于 2019-12-18 11:45:59
问题 Is it possible to change, with the CSS Filter methods like HueRotate, Saturation, and Brightness, the color of a PNG drawn totally white? Like Photoshop's color overlay effect, but in CSS. This would be a good solution to avoid creating lots of images that change only color. For example, a set of icons that have dark and light versions for a UI. 回答1: You can also colorize white images by adding sepia and then some saturation, hue-rotation, e.g. in CSS: filter: sepia() saturate(10000%) hue

RGB to HSL conversion

拈花ヽ惹草 提交于 2019-12-17 22:24:37
问题 I'm creating a Color Picker tool and for the HSL slider, I need to be able to convert RGB to HSL. When I searched SO for a way to do the conversion, I found this question HSL to RGB color conversion. While it provides a function to do conversion from RGB to HSL, I see no explanation to what's really going on in the calculation. To understand it better, I've read the HSL and HSV on Wikipedia. Later, I've rewritten the function from the "HSL to RGB color conversion" using the calculations from

HSB vs HSL vs HSV

旧时模样 提交于 2019-12-17 22:18:48
问题 I am making a Color class as a part of a very basic graphics API in c++. So I decided to take a look at Microsoft's .NET framework and noticed that their Color class has functions for HSB. Then I started a research to determine whether I should provide HSB, HSL or HSV or ALL of them in my class. So, I have 3 questions on HSB, HSL, HSV: Is HSB same as HSL? If not, why isn't there an HSBL or even HSBLV? I find many different methods of calculating these values, can someone show me the FASTEST