Invisible Pixels

Any image except a compressed image in Manifold can have invisible pixels, which do not appear in the image. They are simply placeholders for empty regions of the image. When images containing invisible pixels are stacked above one another in a map, items in layers below the invisible pixels will be visible.


Invisible pixels are a simple, low-overhead way of creating transparent regions within images. They are available within any Manifold image type. Using invisible pixels does not increase the storage size required for the image. The only disadvantage of the invisible/visible pixel facility is that pixels are either completely opaque or they are completely invisible.


If partial transparency is required, two other transparency methods may be used with images:


·      Layer Transparency allows changing an entire image layer's opacity on a percent basis. This works with any image layer in a map. All the pixels in the layer will have the same percent opacity applied. This is a good effect for creating "see through" images for purposes such as aligning images to each other within maps or for creating faint images overlaid on maps to provide guidance. Layer transparency works with any image layer in Manifold and does not add to the storage size of the project.

·      RGBa Pixel Transparency allows setting a different percent transparency for each individual pixel. This allows sophisticated gradients in transparency for the creating of drop shadows, composite images and feathering images. Pixel transparency is normally applied using editing tools such as partial erasers to partially erase various regions or by using gradients as masks for the alpha channel. Pixel transparency is available only within RGBa images, which are larger by one channel than they would be as RGB images.


Selections and other operations can occur with regions of invisible pixels; however, unless we paint color into them using some method such as the paint bucket they will not participate in image operations. For example, adjusting hue, saturation or lightness has no effect on invisible pixels. Painting color into an invisible pixel makes it a regular pixel again.


To Create a Region of Invisible pixels


1. Select the desired region.

2. Choose Edit - Delete from the menu or press the Delete key on the keyboard: The pixels will disappear from the image.


To restore invisible pixels into ordinary pixels, paint the region with any image drawing tool.




Suppose we view the above two images in a map, with the bronze image above the schloss image. ["Schloss" is German for "castle" or "chateau". The image shows the famous Schloss Neuschwannstein in Bavaria.]




We wouldn't be able to see those parts of the castle image covered by the bronze image. We can look at the bronze image in an image window as well as in the map window.




The image window background has been turned off so we can see which parts of the bronze image become invisible. Manifold uses a checkerboard pattern to show regions where there is neither background nor any visible pixels. This makes it easy to see regions that are less opaque.




To create invisible pixels in the sky region, we simply select the pixels in the sky region and then Delete them.




If desired, we could have selected them in the map window and deleted them there.




When we delete the pixels they disappear. They will immediately disappear in the map window as well.




This makes that region of the bronze image completely invisible and allows more of the castle image to become visible.




Any operations applied to the image will not involve the invisible pixels. It is as if those regions of the image are not even there. For example, we can increase the saturation of the bronze image.




We can do this either in the image window or the map window without affecting the schloss image. Any operations we apply will affect only the visible pixels.


It's often the case that we would like to render invisible all pixels except those selected.



Suppose we've selected the region of pixels in South America and we would now like to make all other pixels invisible.



We use Edit - Select Inverse to invert the selection.



Now we can use Edit - Delete to delete the selected pixels and make them invisible. The image is shown with the Border turned on in the Layers pane so we can see the size of the image.


RGBa Pixel Transparency


We can use RGBa pixel transparency in images that have transparent pixels. If the bronze image is an RGBa image, we can vary the transparency of each pixel independently.




For example, if we load the above grayscale gradient as a Mask for the alpha channel in the bronze image we are telling Manifold to vary the transparency guided by the grayscale value of the gradient.




Since the grayscale value increases from black to white this will increase transparency in a continuous gradient from zero transparency at the top of the image to full transparency at the bottom of the bronze image.




It's easy to create complex images mixing many layers of other images with suitable use of invisible pixels, RGBa pixel transparency and transparent layers. We can layer images of different sizes and move about the different layers to achieve the effect desired. For example, if we wanted to add pigeons flying about the statue we could cut pigeon images out of a picture with pigeons and then paste them into layers above the bronze layer, with one pigeon per layer if desired. We could then move the pigeons about by moving their layer, warp the pigeons with perspective effects to make them appear as seen from different angles and perhaps reduce a few in size and desaturate and lighten them to make it seem they are in the distant background.




Just for fun, let's Colorize the schloss image into a light sepia tone to allow the colors of the saturated bronze image to better stand out. We have also taken the liberty of selecting and then deleting the remnant pixels for the upper part of the clouds in the bronze image. The improvement in the composite effect can be seen by comparison with the illustrations below, where the screen shots were made before trimming the clouds and thus a fine outline of cloud layer can be seen in front of the castle.


Invisible Pixels vs. RGBa Pixel Transparency


RGBa pixel transparency is a different mechanism than invisible pixels. Key differences include:


·      Invisible pixels are an "all or nothing" effect: either the pixel is fully visible or it is invisible. Alpha transparency allows a different transparency setting for each individual pixel.

·      Deleting a pixel to make it an invisible pixel is a permanent deletion. The pixel with its original color values cannot be retrieved. Alpha transparency, in contrast, can be changed at any time to restore the original appearance of pixels.

·      Using invisible pixels does not add to the size of the image. Alpha transparency works only with RGBa images and requires a fourth channel for each pixel whether transparency is used or not.

·      Invisible pixels do not take any longer to process than regular pixels. RGBa images take longer to display because transparency for each individual pixel must be reckoned.


Use with Projections and Drawings


Invisible pixels work fine when combined in maps with drawing layers or with projections.




A frequent use is to remove sea areas from photographic images so that graticule lines or other drawing elements in layers below the image can be seen.




Using Select Touch we selected the pixels in sea regions and then deleted them to create the above image in Mollweide projection. See the Invisible Pixels and Selection topic for information on selecting invisible pixels and on using the Invisible Pixels selection in the Selections pane.


Cutting, Copying and Pasting and Invisible Pixels


Some commands will automatically create regions of invisible pixels.



Cutting a selection out of an image leaves a region of invisible pixels.

Copy / Paste

Copying a selection takes only the selected pixels. When pasting from the clipboard into a new image layer, the "empty" region in the rectangular image will consist of invisible pixels.


Painting over Invisible Pixels


We can create "real" pixels in regions of invisible pixels by simply painting into those regions using any painting or drawing tool that works with images.



Suppose we delete the sky pixels in our sample bronze image to create a region of invisible pixels.



We can see the preview of this in the Selections pane using the Invisible Pixels saved selection.



We can paint onto the region of invisible pixels however we like. In the illustration above we've added dots and other figures in green and gold.



Once we paint onto a region those pixels are no longer invisible. The Invisible Pixels saved selection, for example, no longer includes them.


Invisible Pixels in Masks


Any invisible pixels in masks will not participate in whatever the mask is asked to do. If the mask is loaded as a selection, regions of invisible pixels will not be selected. If the mask is loaded as a channel, any parts of the mask containing invisible pixels will not alter the target image.


Saving Invisible Pixels as a Separate Image or Mask


At any time we can save the region of invisible pixels as an image within an image. Such images are called masks and may be used at any time in the future for subsequent selection or channel operations. To save the region of invisible pixels as a mask, we use the Edit - Save Mask/Channel command with the Invisible pixels system saved selection specified in the dialog's Save box.


At any time we can use Edit - Load Mask/Channel to load a mask that specifies a region of invisible pixels. For example, we may have previously saved some selection as a mask and now we would like to use that selection to create a region of invisible pixels in the shape of that selection. We can use Edit - Load Mask/Channel with Load set to Invisible pixels and the region of invisible pixels will be set by the mask being loaded. Note that any previously invisible pixels will remain invisible since making a pixel invisible is always a "one-way" operation that deletes the pixel.


See the Masks topic for a discussion on how Edit - Save Mask/Channel can be used to save different regions for use as selections. It's easy and fun.


See the Invisible Pixels and Selection topic for information on selecting invisible pixels and on using the Invisible Pixels selection in the Selections pane.


Invisible Pixels are not Deleted


Note that when "deleting" pixels the pixels are not really deleted - they are simply made transparent. The only way to delete pixels in an image is to crop the image, in which case the cropped pixels are genuinely deleted.




Consider the example SanFran image on the Manifold CD that shows a LandSat image of the San Francisco Bay area. Note that it has regions of black pixels because the LandSat image is tilted. The black pixels are necessary because all images are rectangular (made up of a rectangular array of X times Y pixels).




We can select the black pixels and delete them.




However, deleting the pixels simply makes them invisible. The image still has the same original extent as it did before. The "deleted" pixels are still there as invisible pixels.




We can see that by turning on the Selections pane for this image and previewing the built-in [Invisible Pixels] selection in blue preview color. Because images must be rectangular there is no way to cut off triangular portions of them.




If we want to reduce the size of the image so that it contains no invisible pixels we must make a rectangular selection and then crop the image to that selection.




This will genuinely delete the cropped pixels, albeit at the cost of cropping the image down to a rectangular region that covers only visible pixels.


See Also


·      Use the Layers pane with images to click ON a background color layer or to show a border around an image.

·      About the Sample Images provides notes on the schloss and bronze sample images.