Hi I was at the search for making e.Graphics.DrawImage turn any image
to Grayscale, and I found two similar solutions but different
ColorMatrix values, what is the difference between the two? Is there
an industry standard for the GrayScale ColorMatrix values?
Thanks,
Henry
Solution #1, Jacob Grass: http://groups.google.com.ph/groups?h...sftngp05#link3
Dim GrayShear()() As Single = New Single()() _
{New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0, 0, 0, 1, 0}, _
New Single(4) {0, 0, 0, 0, 1}}
Solution #2, Bob Powell: http://groups.google.com.ph/groups?h....phx.gbl#link4
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{New Single() {0.3, 0.3, 0.3, 0, 0}, _
New Single() {0.59, 0.59, 0.59, 0, 0}, _
New Single() {0.11, 0.11, 0.11, 0, 0}, _
New Single() {0, 0, 0, 1, 0}, _
New Single() {0, 0, 0, 0, 1}})
These are just portions of the code, I just copied and pasted the
Grayscale ColorMatrix values and they differ from one another. 2 3234
Use the one from Bob to get the true grayscale.
"Henry Wu" <he***********@hotmail.com> wrote in message
news:86*************************@posting.google.co m... Hi I was at the search for making e.Graphics.DrawImage turn any image to Grayscale, and I found two similar solutions but different ColorMatrix values, what is the difference between the two? Is there an industry standard for the GrayScale ColorMatrix values?
Thanks, Henry
Solution #1, Jacob Grass:
http://groups.google.com.ph/groups?h...sftngp05#link3
Dim GrayShear()() As Single = New Single()() _ {New Single(4) {0.5, 0.5, 0.5, 0, 0}, _ New Single(4) {0.5, 0.5, 0.5, 0, 0}, _ New Single(4) {0.5, 0.5, 0.5, 0, 0}, _ New Single(4) {0, 0, 0, 1, 0}, _ New Single(4) {0, 0, 0, 0, 1}}
Solution #2, Bob Powell:
http://groups.google.com.ph/groups?h....phx.gbl#link4
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _ {New Single() {0.3, 0.3, 0.3, 0, 0}, _ New Single() {0.59, 0.59, 0.59, 0, 0}, _ New Single() {0.11, 0.11, 0.11, 0, 0}, _ New Single() {0, 0, 0, 1, 0}, _ New Single() {0, 0, 0, 0, 1}})
These are just portions of the code, I just copied and pasted the Grayscale ColorMatrix values and they differ from one another.
Thanks again Dr. ScrewUp,
I finally got the Magnifier working the way I want it. http://wuhenry.beigetower.org/MagnifierXP-Final.zip
You remember the seperate repaint function you made, that did the
trick for it to not flicker, even when I remove the mouse monitoring
variables, it does not flicker at all. As long as I don't call any
Invalidate :)
Thanks so much,
Henry This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: tjh |
last post by:
hi -
i'm a bit new to PHP - i've been messing around with the GD2 image functions
and was wondering:
i see a lot of information about converting a color image to grayscale but i
can't figure...
|
by: Bill Petzke |
last post by:
I am of the understanding that a ColorMatrix can be used to adjust the contrast of an image. Any idea how this is done?
|
by: RicercatoreSbadato |
last post by:
I'm using bmp.Save() and the bmp is in PixelFormat.Format8bppIndexed.
But when I open the image with Gimp, it tells me that the image is RGB
and not grayscale.
|
by: tlemcenvisit |
last post by:
Hello
I translated this code (witch convert an image to grayscale) from C#.NET to
C++.NET
The C#.NET code is :
private void GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new...
|
by: Harry Simpson |
last post by:
I'm having trouble reducing the size of a bitmap programmatically: The file
size of the original is 2400k.
The picture is 816x1056. 16 million colors i think. I only need grayscale
render.
...
|
by: Brian L. Troutwine |
last post by:
I've recently begun to teach myself pygame by making a bunch of small
toys. My current toy is cellular automata displayer and I've gotten a
bit stuck on the displaying bit. (If automata isn't the...
|
by: Sirin Azazi |
last post by:
i am trying to convert an image into grayscale format. but i have a problem
saving the bmp file after the process.here the code;
for (int y = 0; y < Height; y++)
{
for (int x = 0; x <...
|
by: platinumhimani |
last post by:
-How to convert any image(8,16,24,32 or 64-bit) to 8-bit grayscale
-i have tried to convert a 24-bit image to grayscale using setpixel
and getpixel functions, in vb.net
but i am unable to save...
|
by: Speed |
last post by:
Hi,
Could anyone tell me what is the simplest code to read a 8-bit
grayscale JPEG image using C.
Thanks a ton,
Speed
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |