color-space

How would I represent an HSL and an RGB color as a class in C#?

空扰寡人 提交于 2019-12-24 18:13:12
问题 How would I write a class in C# that represents an HSL color and an RGB color? Once I have that, is it possible to add a method that prints out each of the class attributes? I've heard about ToString() , but I'm not sure how to use it. Some sample code would be very useful, as I am a student and trying to learn how to use C#. Thanks! 回答1: People get annoyed when you post "questions" asking others to write code for you. Lots of questions from new users seem to ask for this, and yours even does

What is perceptually uniform color space and how LAB color space is perceptually uniform? [closed]

ぐ巨炮叔叔 提交于 2019-12-24 00:48:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . What is perceptually uniform color space ? how Lab color space is perceptually uniform and device independent? 回答1: slhck is right: a perceptual uniform color space ensures that the difference between two colors (as perceived by the human eye) is proportional to the Euclidian distance within the given color

NV12 format and UV plane

守給你的承諾、 提交于 2019-12-23 10:14:05
问题 i am a little confused about the NV12 format. i am looking the this page to understand the format. What i currently understand is that if you have an image or video of 640 x 480 diminsion then the Y plane will be having 640 x 480 bytes and U and V both planes have 640/2 x 480/2 . It does not mean that U plane have 640/2 x 480/2 and V plane have 640/2 x 480/2 both have only 640/2 x 480/2 bytes. so the total number of bytes in out buffer array will be. 2 is multiplied with (640/2) * (480/2)

ImageMagick: convert keeps changing the colorspace to Gray. How to preserve sRGB colorspace?

二次信任 提交于 2019-12-23 07:27:51
问题 I have a batch script that converts my PNG-24 (with Transparency) images to 50% and 25% size (for mobile development). Usually these images have colors in them but now I am trying to convert an image that has no colors and ImageMagick keeps changing the colorspace profile to "Gray", which messes up my image in the 3d engine I'm using (Unity). I have tried forcing it to use type TrueColor, colorspace sRGB, and the sRGB.icc profile (the one included with OSX) but it doesn't seem to care. It

Boundaries of the visible gamut in a CIE color space

删除回忆录丶 提交于 2019-12-22 21:46:27
问题 I would like to know if there is any mathematical way to determine the boundaries of the visible spectrum/gamut in a CIE color space ( e.g. Lab, XYZ). Thank you in advance! 回答1: mmm... this seems to be a not-so-good formulation of a valid question. As boscarol pointed it out, the boundary of the human gamut is determined by the "color matching functions" that you will decide to use, which refer to the type of "standard observer" you need, i.e., 2° (1931, often used) or 10° (1964, a bit rare)

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 /

Determine that a Luv Color is non-imaginary

喜夏-厌秋 提交于 2019-12-22 00:10:55
问题 Suppose I have a triple of coordinates in the Luv color space. What is the best way to determine that these correspond to a real color? 回答1: Assuming your L* is in domain [0, 100], you can construct the boundaries of the Visible Spectrum and then determine if your CIE L*u*v* coordinates are within it. import colour import numpy as np def generate_square_waves(samples): square_waves = [] square_waves_basis = np.tril(np.ones((samples, samples)))[0:-1, :] for i in range(samples): square_waves

Why is color segmentation easier on HSV?

☆樱花仙子☆ 提交于 2019-12-21 20:33:08
问题 I've heard that if you need to do a color segmentation on your software (create a binary image from a colored image by setting pixels to 1 if they meet certain threshold rules like R<100, G>100, 10< B < 123) it is better to first convert your image to HSV. Is this really true? And why? 回答1: The big reason is that it separates color information (chroma) from intensity or lighting (luma). Because value is separated, you can construct a histogram or thresholding rules using only saturation and

how to display MTKView with rgba16Float MTLPixelFormat

可紊 提交于 2019-12-20 04:54:25
问题 I have an MTKView set to use MTLPixelFormat.rgba16Float. I'm having display issues which can be best described with the following graphic: So the intended UIColor becomes washed out, but only while it is being displayed in MTKView. When I convert the drawable texture back to an image for display in a UIView via CIIMage, I get back the original color. Here is how I create that output: let colorSpace = CGColorSpaceCreateDeviceRGB() let kciOptions = [kCIImageColorSpace: colorSpace,

Why is there such a difference between RGB to XYZ color conversions?

≡放荡痞女 提交于 2019-12-20 02:49:06
问题 Recently I have been trying to understand code that converts between the RGB color space and the CIE-XYZ color space, but it seems like every different calculator I try gives me radically different results. For example, trying to convert (255, 100, 70) to XYZ yields the following result, even when explicitly using d50 for everything: EasyRGB gives (46.903, 30.817, 9.270) Wolfram Alpha gives (0.7493, 0.7245, 0.6308) Bruce Lindbloom.com gives (0.493910, 0.317574, 0.070047) Java gives (0