ImageAdv.convertToGrayscale() | This page was last modified over 30 day(s) ago and has 0 comment(s)
|
Back to ImageAdv Class Summary |
Availability |
Windows, Mac OSX, Linux |
Usage |
mdm.ImageAdv.convertToGrayscale():Boolean |
Parameters |
none |
Returns |
boolean that indicates if operation succeeded |
Description |
This method effectively removes all color information from 24/32bit color spaced bitmaps and saves only luminance information (8-bit). Please note that operation is destructive and cannot be reserved - but it operates on in-memory hosted copy of your originally loaded image data. |
Notes |
This operation does not change your original file. It operates on bitmap hosted in memory - so you have to flush changes to local file to persist them by saving JPEG/PNG files locally. |
Example Code |
if(image.isValid) { var converted:Boolean = image.convertToGrayscale(); if(converted) { image.savePng(outputPath); }; }; |
mdm.ImageAdv Class Example Downloads |
No Example Downloads Available |
![]() |
Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here |
After Logging In, Click Here to Refresh This Page |