Is it possible to programmatically manipulate a bitmap/image/picture in Photo Paint? In other words, read the pixels of the bitmap, do some calculations and write a new bitmap? I am trying to do a purple filter (hue=300), similar to a red, green, or blue filter. I haven't found where to get at the pixels is this beyond VBA or VSTA can do in Photo Paint?
I have no experience using it - but have you looked at ImageJ?
I also needed to read out of pictures the RGB-Values. The only way I saw was, to save my picture (in Corel Draw) as a 24-bit Bmp-File. Then I opened this image as a binary file (again within CD), skipped the header and read in the binary bytes row by row for my evaluation.After the header (see Wikipedia for more details) the first 3 byte describe the lower left (if I have it correct in mind) pixel, the next set then the second in the lowest row and so on.This is - honestly said: not an easy - way to get some information about the colour on a certain position of the screen, but the only I know (until now)
I'm not seeing a way to adjust the hue with VBA in Photo Paint, but if your end goal is to alter the hue, you could try the following.
1. Import the image into CorelDRAW.
2. Create a rectangle the same size as the image.
3. Set the outline to none and the fill to purple.
4. Use the lens tool to turn the rectangle into a filter.
5. Export as a raster image.
The VBA code "ActiveLayer.Shapes(1).CreateLens 3, 50, CreateRGBColor(170, 0, 255)" without quotes, will change an active shape into a filter.
CreateLens 3 = Color Add
CreateLens 4 = Color Limit
CreateLens 9 = Transparency
50 is the amount the the filter affects the image below and the RBG color would have to be adjusted to suit your needs.
Once you figure out your settings, you should be able to create a simple macro in CorelDRAW that programmatically accomplishes steps 1-5 above.
Hope this helps
Guys, thanks for your feedback. Yeah, I didn't want to try and read the file format myself. The Red, Green, and Blue filters/merge modes were so close, but the wrong hue. The Hue filter wasn't right either. Also, I wasn't trying add hue (such as Purple=300), I was trying to leach out anything that wasn't Purple, like looking at the image through a purple filter.
And for future reference, my final solution was to write a Python program using Pillow to read, modify, and save the image. I also looked at OpenCV, but that seemed a bit more involved than I needed for a simple one-shot project.