Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Learning about pictures and masks (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: open-source RB builder
Next thread: application language


Win32 API Declares   -   Berg, Heath
  Learning about pictures and masks   -   Paul Howson
   Re: Learning about pictures and masks   -   Mary E. Tyler
   Re: Learning about pictures and masks   -   Joseph J. Strout

Learning about pictures and masks
Date: 18.08.05 20:08 (Fri, 19 Aug 2005 05:08:07 +1000)
From: Paul Howson
Could someone answer a couple of basic questions about pictures and
masks please?

1. The docs talk about masks working for pictures which have 16 or 32
bit depth. For a 32 bit depth picture, I assume 24 of those bits are
the 3 x 8 bits of RGB values. What are the other 8 bits used for?

2. When a 32 bit mask is applied to a 32 bit picture, does the R
channel of the mask mask the R channel of the picture, and so on?

3. What happens if you use an 8 bit picture as a mask -- i.e. a
greyscale picture. Is the greyscale mask applied identically to each
of the RGB channels of the 32 bit picture?

Is there any good documentation or examples of how this works? The
Language Reference is a bit light on.

Paul Howson

----------------------------------------------------------------
The Design Group Qld, Warwick Qld Australia
web: www.tdgq.com.au email: <email address removed>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Learning about pictures and masks
Date: 19.09.05 15:10 (Mon, 19 Sep 2005 10:10:15 -0400)
From: Mary E. Tyler
>>3. What happens if you use an 8 bit picture as a mask -- i.e. a
>>greyscale picture.
>
>Good things. Indeed, that's what you may get -- Picture.Mask
>returns to you an 8-bit grayscale picture on some platforms in some
>versions of REALbasic. (But again, even if you discover that your
>mask actually has some other depth, you should treat it as 8-bit
>grayscale.)

What a mask does is this:

If the mask pixel is black, the image's color is passed through unchanged.

If the mask pixel is white, the image's color does not come through at all.

If the mask pixel is some shade of gray, the image's color comes
through changed. The gray pixel will reduce the intensity of the
image's color.

Or something like that.

dej

Re: Learning about pictures and masks
Date: 18.08.05 20:17 (Thu, 18 Aug 2005 13:17:12 -0600)
From: Joseph J. Strout
At 5:08 AM +1000 8/19/05, Paul Howson wrote:

>1. The docs talk about masks working for pictures which have 16 or
>32 bit depth. For a 32 bit depth picture, I assume 24 of those bits
>are the 3 x 8 bits of RGB values. What are the other 8 bits used for?

Nothing.

>2. When a 32 bit mask is applied to a 32 bit picture, does the R
>channel of the mask mask the R channel of the picture, and so on?

No, the mask should be grayscale; the same masking is applied to all
three channels of the image. If you load non-gray data into a mask,
the result is undefined.

>3. What happens if you use an 8 bit picture as a mask -- i.e. a
>greyscale picture.

Good things. Indeed, that's what you may get -- Picture.Mask returns
to you an 8-bit grayscale picture on some platforms in some versions
of REALbasic. (But again, even if you discover that your mask
actually has some other depth, you should treat it as 8-bit
grayscale.)

> Is the greyscale mask applied identically to each of the RGB
>channels of the 32 bit picture?

Yep.

Best,
- Joe