gamma

Gamut / Color space problems when using CGContextDrawPDFPage

余生颓废 提交于 2019-12-24 06:45:18
问题 I'm rendering a PDF file on iPad using core graphics. The colors however look different to the PDF when opening it using OS X preview or acrobat. Here is a picture with the left being from Acrobat, the right being in iOS simulator: Does anyone have an idea what I could be doing wrong? I'm not doing anything fancy with my graphics context, except translation/scaling, clipping and then calling CGContextDrawPDFPage (So far I have only tried on the iOS simulator. ) 回答1: You need to use RGB

iOS Metal. Why does simply changing colorPixelFormat result in brighter imagery?

人盡茶涼 提交于 2019-12-24 00:48:43
问题 In Metal on iOS the default colorPixelFormat is bgra8Unorm . When I change format to rgba16Float all imagery brightens. Why? An example: Artwork MTKView with format bgra8Unorm . Texture-mapped quad. Texture created with SRGB=false . MTKView with format rgba16Float . Texture-mapped quad. Texture created with SRGB=false . Why is everything brighter with rgba16Float . My understanding is that SRGB=false implies that no gamma correction is done when importing artwork. The assumption is the

gamma or log gamma function in C or C [closed]

别说谁变了你拦得住时间么 提交于 2019-12-23 13:33:20
问题 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 5 years ago . I am seeking a C or C++ version of gamma and log gamma functions. Are there any code pieces or libraries recommended? If possible, I want to know the principle of the implementations. Thank you!!! 回答1: If you can't use C++11: The GNU GSL has all Gamma function you would ever need: http://www.gnu.org/software/gsl

Tweak the brightness/gamma of the whole scene in OpenGL

怎甘沉沦 提交于 2019-12-19 03:59:37
问题 Does anyone know how I can achieve the following effect in OpenGL: Change the brightness of the rendered scene Or implementing a Gamma setting in OpenGL I have tried by changing the ambient parameter of the light and the type of light (directional and omnidirectional) but the result was not uniform. TIA. Thanks for your help, some additional information: * I can't use any windows specifics API. * The gamma setting should not affect the whole window as I must have different gamma for different

OpenGL: Gamma corrected image doesn't appear linear

孤街浪徒 提交于 2019-12-12 09:39:05
问题 I'm using OpenGL for rendering, and when I write linear values to the default framebuffer (without any gamma correction) they appear linear on my monitor. This goes against everything I thought I knew about gamma correction (as explained here: http://gamedevelopment.tutsplus.com/articles/gamma-correction-and-why-it-matters--gamedev-14466 ). Without gamma correction, I would expect to see mid-range colors darkened non-linearly by my monitor. But here is what I actually see; first with no gamma

What to do if tgamma() function is not defined?

空扰寡人 提交于 2019-12-12 03:57:15
问题 I am trying to use tgamma() from the standard library. When I try to compile, I get the error message: Call to undefined function tgamma I have the directive #include <cmath> . I use Embarcadero C++ Builder XE3, which claims to support C++11 standards. What could be my problem, and how to fix it? 回答1: Boost contains a tgamma function. #include <boost/math/special_functions/gamma.hpp> ... double rootPi = boost::math::tgamma<double>(0.5); Of course, you can always switch to a different compiler

Estimate ratio of two gamma functions when individual functions return inf value

主宰稳场 提交于 2019-12-11 03:49:49
问题 I'm estimating the ratio of two gamma functions. Both estimates for gamma(x) and gamma(y) are very large ( > 10^300) but the ratio of the two should be fairly small. from scipy.special import gamma gamma(x) / gamma(y) Unfortunately, there is a point where gamma(x) is too large and the scipy returns an inf value. Is there a way to stop this, increase the threshold, or alternatively calculate this ratio? Thanks 回答1: Assuming x and y are real and positive you can use the following identity: a /

OpenGL: Gamma corrected image doesn't appear linear

强颜欢笑 提交于 2019-12-10 04:59:31
问题 I'm using OpenGL for rendering, and when I write linear values to the default framebuffer (without any gamma correction) they appear linear on my monitor. This goes against everything I thought I knew about gamma correction (as explained here: http://gamedevelopment.tutsplus.com/articles/gamma-correction-and-why-it-matters--gamedev-14466 ). Without gamma correction, I would expect to see mid-range colors darkened non-linearly by my monitor. But here is what I actually see; first with no gamma

Image Equalization to compensate for light sources

荒凉一梦 提交于 2019-12-08 09:03:12
问题 Currently I am involved in an image processing project where I am dealing with human faces. But I am facing problems with the images in cases where the light source is on either the left or right side of the face. In those cases, the portion of the image away from the light source is darker. I want to distribute the brightness over the image more evenly, so that the the brightness of darker pixels is increased and the brightness of overly bright pixels is decreased at the same time. I had

Gamma correction doesn't look properly corrected, is this linear?

安稳与你 提交于 2019-12-07 14:21:23
问题 I want to implement gamma correction to my OpenGL lighting, but with gamma correction applied, my results do not seem linear at all. I also found OpenGL: Gamma corrected image doesn't appear linear which is very similar to my issue, but hasn't yet received an answer nor discussed actual diffuse lights. As an illustration, I have the following 4 light colors defined in linear space: glm::vec3 lightColors[] = { glm::vec3(0.25), glm::vec3(0.50), glm::vec3(0.75), glm::vec3(1.00) }; With each