question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grayscale conversion adds 0.5 to every pixel value

See original GitHub issue

Hi!

I’m having strange results when converting an image to grayscale with the latest version (7.0.7.700). The following simple code demonstrates the problem:

MagickImage img = new MagickImage("pathtoimagefile");
img.Grayscale(PixelIntensityMethod.Average);

If I take look the pixel values a completely black image has values of 0.5 on R, G and B channels. Different PixelIntensityMethods give the same result.

Best regards

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Mar 11, 2018

@48design Can you give it another try with the latest release?

0reactions
48designcommented, Mar 29, 2018

Sorry, had to stop the project for a while… YES, it works! Thank you very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Get an Average Pixel Value of a Gray Scale Image ...
This can be done using PIL by looping over the pixels, accumulating all pixel values and dividing by the number of pixels (i.e....
Read more >
How to Manually Scale Image Pixel Data for Deep Learning
You can center first, to have pos/negative values around 0, then normalize and use the same scale value for the upper and lower...
Read more >
GrayScale Conversion - samir khanal - Medium
Each pixel has its pixel values with three values: Red, Green and Blue. Grayscale conversion means converting an image into gray representation, omitting...
Read more >
Seven grayscale conversion algorithms (with pseudocode and ...
All grayscale algorithms use the same basic three-step process: Get the red, green, and blue values of a pixel; Use fancy math to...
Read more >
Three algorithms for converting color to grayscale
I used the luminosity method to get a gray value for each pixel, then the Floyd – Steinberg dithering algorithm. Since the colors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found