Hi,
Could you please help me.
Is there macro can check if an image is all white or fully transparent?
The Input will be path like this C:Usersehab.aliDesktopNew folder1000012.png in Column "A"
The output will be in Column B >> Status : White or Transparent or Color?
Thanks;
Marsil
Hi,
I haven't done this before but you may be able to use TransparentBackground to check if the image has any transparency
https://docs.microsoft.com/en-us/office/vba/api/excel.pictureformat.transparentbackground
I'm not aware of any function to check if an image is all white (or just one color) . If one doesn't exist then I can only think that you'd have to check each pixel and you could do this with Windows API calls
https://stackoverflow.com/questions/16528319/read-pixel-colors-of-an-image
https://stackoverflow.com/questions/44847008/how-to-read-pixels-from-a-picture-file-with-excel-vba
https://stackoverflow.com/questions/45998565/scan-image-pixel-by-pixel-in-vba
Regards
Phil
Hi Philip,
Thank you very much for your support and valuable information.
Please can you help to create the macro and how I can use it for below code.
https://docs.microsoft.com/en-us/office/vba/api/excel.pictureformat.transparentbackground
Can you please send me sample in macro.
Thanks;
Marsil
Hi Marsil,
Have you tried to write the macro? I'm happy to help you out if you get stuck but I'm sorry I don't have time to write things from scratch. The best way for you to learn is to give it a go 🙂
Regards
Phil