Buffers

The swap buffer
Storing buffers
The clipboard
Transforming
Flipping
Rotating
Resampling
Resizing
Cropping
Grayscale
Invert
Dynamic range
Clearing and filling
Swap mixing
Buffers with animation

The buffer consists of a main bitmap (an array of data) that contains your working image, a swap bitmap (or swap buffer) and an alpha channel.  The alpha channel is an 8 bit bitmap that can contain a matte or mask that can be used like a template or selection.

The Swap buffer

The swap buffer can be useful in many ways.  You can use it to store a spare copy of an image, or to store a checkpoint for your work.  You can rub one buffer through to the other, or you can use it with some filters to displace, merge, composite, or generally modify your main buffer.

To swap buffers, press the j key.

Pressing the J (capital j) key will copy the current buffer to the swap buffer.

 

The current buffer is displayed in the main title bar.  It appears as either (Main) or (Swap)

 

There are menu items under the buffer menu for managing your buffers.

Swap buffers swaps the Main and Swap buffer
Copy to swap copies the current buffer to the swap buffer
Copy swap buffer to alpha copies the swap buffer to the Alpha channel.
Copy alpha to swap buffer copies the alpha channel to the swap buffer.

 

When you copy the swap buffer to the alpha channel, it is converted to grayscale.

Storing buffers for later use.   

Under the Buffer menu, you will see the option to Store a buffer.

Generally since PD is a dedicated painting application, you work on one image at a time, however should you wish, you can store a buffer or a number of buffers to access at any time.

Storing a buffer puts it into it's own window that can be minimized for later use.  To restore it back to your main buffer, all you have to do is click on the thumbnail.
But suppose you do not want to obliterate your current image.  You still have several options.  You could swap buffers, and work on a blank buffer while your image is safe in the other buffer.  You could also use several combine modes to combine your images in interesting ways.

By clicking on the Functions button, you get a menu of options.

Replace image replaces the current buffer with the one that was stored.  If your buffer has changed size, it will be cropped into the new size.

The combine menu lets you combine the stored image with the current image in a number of different ways.

Replace alpha replaces the current alpha with the one that was stored with the buffer.

Use image as alpha converts the stored buffer to a grayscale image and uses it as the alpha channel.

Replace existing buffer replaces the current buffer with the stored buffer, obliterating whatever you are working on.  If needed, the buffer will be resized.

RGB Channels copies any of the Red green or blue channels of the stored image into the main buffer.  Say you only wanted to work with one channel, you could store your image, clear your main buffer and get just the one channel you wanted to work on.  When you are done, you can add in the other two channels.

HSV Channels converts the stored buffer to HSV space and copies any of the Hue, saturation, or Value buffer into the main buffer as a grayscale image.

YUV Channels converts the stored buffer to YUV space and copies any of the YUV buffers into the main buffer as a grayscale image.

Working with Red, Green, and Blue channels independently, using Store buffer.

As an example, this image was cleaned up extensively by modifying only the blue channel, which contained most of the film grain in the image.

The process was to store the original image and clear the buffer to black.  The blue channel was then added back, and a median filter was applied to it several times to reduce the grain.  Then the red and green channels were added back to the image.


Copying buffers to / from the clipboard

You can copy your entire buffer to the system clipboard with the Copy to clipboard menu item under the Buffer menu.

New from clipboard creates a new buffer from an image contained on the system clipboard, destroying any previous buffer.

Overlay from clipboard places the contents of the system clipboard into the current buffer.  If the image on the clipboard does not fit in the buffer, it will be cropped.

If you want to place an image from the clipboard into your buffer manually, one way to do it would be to load it from the clipboard into a custom brush, then stamp it down manually.  See the section on custom brushes for more information.

One neat trick with the system clipboard is to copy formatted text from a text editing application.  It will automatically be converted to a bitmap that you can use.  You can do this with any of the tools that support the system clipboard.
Copying text from an editor...

It is converted to a bitmap...


Transforming buffers

There are several transformation options available that work on buffers.  (It's worth noting that all of them also work on entire animations)

Flipping a buffer creates a mirror image.
In the examples, the image is flipped on the horizontal axis, and on the vertical axis.

Rotating a buffer tilts the image, like turning a photograph sideways by 90 degrees.

 


Original image

Flip x

Rotate Clockwise

Flip y
Resampling

Resampling, or scaling a buffer changes the size of the image by stretching it to fit a new size.

The list on the left of the panel lets you select from a number of preset sizes.  These are image formats often used in the field of video production.  It is possible to edit this list.  See the section on preferences for more information.

If you do not want to use one of the preset sizes, you can enter your own image size in pixels into the text boxes on the right.

The Constrain check box forces your new size to match the same aspect ratio as the original image.

The dropdown control lets you select the type of interpolation used to resample the image.  Since images are composed of a series of pixels, it is necessary to interpolate them to get a smoother result.
The interpolation types are nearest neighbor, bi-linear, and bi-linear+.
The "+" in bi-linear+ means that the image is also super-sampled, or multiple samples are taken of every pixel when they are scaled, for a better result.

The flip control   at the bottom changes the orientation of the image by flipping the width and height.

Resizing

You can change the Buffer size without scaling the image.  This results either in the image being cropped, or in new areas being revealed.

The area at the top shows you the size of your original image, and the middle section lets you set the new size, in pixels.

The Anchor lets you specify where in the new image that the old image should be placed.

Say you wanted to make some room to add some text to the top of a picture.  You could add 100 pixels to the height of the image, and change the anchor so the image would keep to the bottom.

The new area will be filled with the secondary color

Crop to Selection

You can crop an image to keep only the part that interests you.

This is like chopping of parts of a photograph with scissors.

  To do so, 'select' the area you want to keep with an alpha channel tool, like the Rectangle to alpha tool on the tool panel.

Use it to create a marquis around the area.

Select 'Crop to selection' from the buffer menu, and your image will be cropped.

You can also create a selection numerically.

Result of cropping.

See the section on the Alpha channel for more information.

 

The next few features act like filters to change the appearance of the image in the buffer.  The difference between the features on the buffer menu, and the ones under the Filter menu is that the alpha channel is ignored, and that all the buffer features work on animations.

Grayscale

The Grayscale menu item converts a color image into a greyscale image.  The two modes are Average, and Video weighted.

In the first case, the red, green, and blue channels are mathematically averaged with the formula (R+G+B)/3

With Video weighting averaging, the channels are averaged in a way that is more consistent with human vision and video systems.  The formula is 0.299 * red + 0.587 * green + 0.114 * blue.

Inverting an image

Inverting an image creates a negative like you may or may not remember from the old days of film cameras.
Expanding dynamic range

Expanding dynamic range is a quick way to automatically adjust the contrast of an image.

Dynamic range refers to the ratio of the highest (lightest)  ,to the lowest (darkest) intensity or value in an image.

In a 24 bit image, with 8 bit per channel, the highest value for any channel is 255, and the lowest value is 0.  If the value for a pixel in all three channels is 0, then the color is black.  If all the value for all channels is 255, then the color is white.

However, not all imaging devices capture perfect blacks or whites, and may give you an image that looks muddy.  Expanding the dynamic range can often make these images look nice.

A histogram shows the effects of expanding dynamic range.  The closer the range of values is to the edges of the histogram, the more contrast your image will have.


Clearing and filling

Clearing a buffer from the buffer menu clears it to the secondary color.  Aside from this, there are several more options if you right click the clear button on the tool panel.  You can clear the whole buffer, or you can clear a 'selection' made with the alpha channel tools.

There is also the option to clear all the frames of an animation.  They will be cleared to the secondary color.

If you want to fill your buffer to a specific value, or if you want to fill using any of the Fill tools, then you can use the Fill item under the buffer menu.  It fills the buffer, or your current selection using the current fill mode.  This mode can be a plain color, a gradient, a pattern from a custom brush, or a number of other effect.  See the section on Fill tools for more information.

Paint fill is a special tool that fills the buffer or selection with a paint like effect.  The values in the alpha channel have an impact on the result of the paint fill.

Adjustable paint fill goes a step further and lets you adjust the effects orientation with a rubber band control.

 

You can make your paint fill fade out like a brush stroke.  The effect is also heavily effected by your current opacity.


Buffer mixing

Very similar to the idea of Layer Mixing, is Buffer mixing.  In fact, they are part of the same sub system, but buffer mixing has its own uses if you only want to work with your main and swap image. See the section on Layer Mixing to learn more.
The buffer mixing options can be accessed from the icon on the top, right of the tool panel (they are also available on the Layer mixing panel)

Right click on the icon to bring up the menu.

 

 

Swap mixing activates swap mixing.  Your buffer will be mixed with the swap buffer visibly in real-time as you work.  The buffers remain separate, but you can see the results of them being combined on screen.

Swap buffers swaps the main and swap buffer. It’s the same as pressing the ‘j’ key.

Merge with swap causes the two buffers to be merged using the current mixing mode.  See below for an explanation of the mixing modes

Open layers panel opens the layers panel should you need it.

Set current layers mode lets you change the current layer's mode, or in this case, the mode for the swap mixing.  If you where working with layers, you could change the current layers mode.

Set tracing paper opacity lets you change the opacity of the trancing paper mixing mode.

Show alpha causes the image thumbnail to represent the alpha channel.

Note Layers are not saved with a file, so you will have to merge your layers before saving your image.
 

With this submenu, you can set the current mode for buffer mixing. Default mode is currently the Multiply mode.

Additive Adds the RGB values of the main and swap buffers

Subtractive subtracts the main buffer from the swap.

Multiply mode multiplies the pixels of the swap and main buffers (and divides them by 255.) The result is similar to painting with ink on ink. The result is always darker.

Divide is the complement of multiply. Use it as you see fit.

Screen is similar to additive but keeps an image from ‘blowing out’ or becoming overly bright. It’s often useful for effects like stars and fire.

Around gray combines two colors around their middle brightness level.

Tracing paper lets the swap buffer show through, a lot like tracing paper.

One way that the swap buffers is  useful; you can use the swap buffer to displace your main buffer.  See the section on Displacement filters for more information

 

Buffers and Animation
                                   

Have your recorded an animation, but you want to crop off the edges?  Need to scale your animation down to size?  Basically anything you can do to a buffer from the buffer menu, you can also do to an animation.


Here, the animation has been inverted.

See the section on the timeline if you want to apply FX filters to an animation.