[3D Rendering Tutorial]
Layers v Objects for bitmap handlingTom Arah looks at the use of layers and objects in current photo-editing programs and asks whether there is a better way.
It's easy to forget just how radically both the working method and end results of computer-based photo-editing have changed over the last few years. Right up until the third version of Photoshop for example, work was pretty well limited to single images. Occasionally sections would be brought in from other files as floating selections, but after sizing and positioning they effectively merged into the existing image. In other words there was no room for experimentation, you had to know exactly what effect you wanted and exactly how to produce it.
The introduction of layers changed all that by allowing multiple image selections to be handled while still remaining independent. The best way to begin understanding the idea is, as the Photoshop manual puts it, to "think of layers of acetate stacked one on top of the other. Where there is no image on a layer, you can see through to the layers below. Behind all the layers is the background. All layers in a file share the same number of pixels". To create a photomontage therefore you simply move and reorder your layers just as you would a pile of acetates.
In fact layers are much more sophisticated than simple acetate as each layer can interact in different ways with those below it. Rather than 100% opaque, for example, the pixels on a layer can be made 50% transparent by halving each pixel's RGB values and adding them to the corresponding values of the pixels below. Alternative effects can be achieved through blending modes based on different methods of computing the final visible pixel value. Photoshop offers fifteen of these ranging from only showing a layer's pixels if they are lighter or darker than those below to advanced effects based on the pixels' hue or saturation levels. In this way layers offer far more scope for experimentation and creativity within the composition process.
A typical example of the use of layers is the sample image I created for the Photoshop masterclass in issue 29. This was a preview of a proposed art exhibition made up from a background image of an existing gallery with various paintings and statues imported from different sources. Each of these was kept on its own layer so that they could be easily rearranged and their placement fine-tuned. The use of layers also made it possible to add effects so that the statue, for example, was given a shadow by duplicating its layer, skewing the result, colorizing it and setting it to blend in with the floor.
The use of layers in this way is fundamental to the shift away from the simple enhancement of scanned images to the origination of completely new images. This is a process that Adobe claims is only limited by your imagination, but sadly it is also limited by the clumsy mechanics of the Photoshop system. In particular all control over layers is funnelled through the less than friendly onscreen Layers Palette. To be able to work on a layer it must first be selected from its thumbnail on the palette and only this one layer will then be active and editable.
With users who know what they are doing these limitations are inconvenient as they require repeated and unnecessary trips to the palette. To arrange the exhibits for the gallery, for example, it is not possible to simply click on each in turn to reposition and resize them. Instead to position the layers it is necessary to activate each one on the palette and then to select the dedicated move tool to drag them into place. Resizing is even more complicated as it involves first selecting the non-transparent pixels of the layer and then calling up the Free Transform command. All told, more work seems to be involved with the toolbox, menus and layer palette than with the actual image.
The process isn't just clumsy and counter-intuitive it can also be destructive. Users naturally expect to be able to paint on or correct the visible image, that is the pixels that are not transparent and are on the top of the stack. However if the pixels on the currently selected layer are obscured by pixels on the layers above it will seem as if there is no response. This is infuriating enough, but far worse is the fact that you are actually painting, you just can't see it! Trying to recolour the base of the statue for example, with the shadow layer selected will show no immediate results, but if the statue is moved it will show that the underlying shadow has been affected.
An Object Lesson: Image Composer
Comparing this process to the object system used by drawing programs, where direct selection is simple and you always know what elements you are working with, shows that there must be a better way. Microsoft clearly feels the same and says as much in the documentation for its recently released Image Composer: "In many image editing programs, images must be manipulated through layers, which can be confusing and tedious work." Rather than image-wide layers the Microsoft solution is built on defined objects or what it calls "sprites". Each sprite is an "area of pixels whose area is defined by its bounding box and whose shape is defined by its transparent pixels."
What this means in practice is a more drawing-like approach to bitmap editing. Each image is built up of multiple sprites that can be rendered shapes, or text, or imported image selections. These are not selected through thumbnails on a palette, but directly on the image with a dedicated selection tool. Clicking on a sprite enables its bounding box, dragging within the bounding box repositions the sprite, dragging on the side handles resizes the object and dragging on the rotation handle rotates it. This is completely intuitive and makes composing the image child's play.
Also very useful to the compositing process is the fact that the size of the image is not predetermined and fixed as it is in all other photo editors. There is an underlying composition guide that determines what elements will be printed or exported, but sprites can be stored outside this guide on an infinite workspace and brought into play as and when needed. Overlapping sprites are controlled with simple bring-to-front and send-to-back commands. It is also possible to group and ungroup sprites and to lock them into place once you are happy with their arrangement.
Not all good news...
Overall the experience of arranging an image is more reminiscent of working within a program like Corel Draw than in Photoshop and it is amazingly refreshing to see just how flexible the process can be. For a job like setting up the exhibits for our exhibition image the use of sprites would be ideal. However there are problems. In particular the fact that there is no background image means that it's not possible to just select a paintbrush and paint. Instead it's necessary to draw a shape with one of the shape tools and then render it. Even then picking a paint tool is unnecessarily complex and it seems as if Microsoft in its determination to be fresh and different has ended up being obscure.
More importantly, the creative options offered by the Image Composer sprites are very limited when compared to those of Photoshop's layers. Each sprite has Red, Green and Blue channels for defining its colour and a separate alpha channel for defining its opacity. However, in spite of this, there is no easy way of controlling and fine-tuning a sprite's transparency. Instead transparency must be applied awkwardly and permanently by applying a wash filter. Also, as there are no blending modes, there are no options for producing creative effects such as the hue of text interacting with the underlying image.
In a way this would be a lot to ask for from version 1.0 of any program, but it's important to realise that there is no intrinsic reason why the sprite model shouldn't offer these features. Layers and sprites might be used very differently, but in fact they are essentially identical with sprites simply being the non-transparent pixels on a layer. This core interchangability is shown by the fact that it is possible to open, work on and save Photoshop *.PSD files directly from Image Composer with layers being seamlessly converted to sprites and vice versa.
It's a weird and exciting experience loading and manipulating Photoshop files in Image Composer and for certain jobs it might be useful to arrange the composition in Image Composer and then export it for creative fine-tuning in Photoshop. Even so it would obviously be better to combine the compositing capabilities of sprites and the creative control of layers within the one program. The best attempt at this I've come across is the system employed in Ulead's PhotoImpact.
The PhotoImpact Solution
As with Image Composer, PhotoImpact montages are built through an object-based system. These objects are created whenever selections are moved, or pasted into an image, or whenever text is added. As with the Microsoft program, these objects are selected and repositioned directly on the image with the default selection tool. However, to resize, skew, slant or rotate the object the separate and more powerful transform tool is used in conjunction with the object's bounding box. Objects cannot be stored outside the main image area, but if they are dragged off the image they automatically open their own new window. Alternatively, they can be dragged onto the object library palette where they are stored for future use in any image.
Combined with simple grouping and ungrouping and its multiple levels of undo, PhotoImpact's compositing power is easily a match for Image Composer's. Where it leaves the Microsoft program behind is in the creative control it then offers over its objects through the Object Properties command. This small dialog hides a lot of power including the ability to choose from thirteen blending modes. It also allows overall transparency to be set and even enables this to be limited to particular colours. The object can also be hidden and revealed and, when it is finally positioned and ready to be merged, its edge can be feathered to blend in with the underlying image.
This combination of compositional and imaging functionality is excellent. A good practical example of the system in action is a sample image built up of multiple overlapping animal objects. Working in an image like this in Photoshop would be a real headache involving constant jumping to the layer palette to ensure that you were working with the right animal. While it is possible to work in this way with PhotoImpact's Layer Manager palette, it is far easier to reposition, resize, duplicate and group objects directly on the image. It's even possible to automatically add semi-transparent shadows so that a process that was previously a chore becomes simple and enjoyable.
Inherent Object Problems
In a way PhotoImpact offers the best of both the object and layer models, but unfortunately there are complications inherent in its bounding box approach. A good example is if we wanted to turn one of the animal objects from an Indian elephant into an African elephant by increasing the size of its tusks and ears. This simply isn't possible directly as editing is limited to the area within the bounding box. Another example is if we wanted to create a cage in front of the animals. Again this wouldn't be possible directly as each object must already exist to be brought into the composition, it cannot simply be created from scratch from within the image.
In both cases workarounds are possible but, as these would involve editing or creating objects in separate windows and then bringing them back into the composition and resetting their transparent colour, these aren't really practical. Moreover, because the cage layer would be image-wide and on the top of the stack, it would make it impossible to select any of the underlying objects without resorting to the Layer Manager so the main advantage of direct selection would be immediately lost. For bringing together existing selections to create a composition PhotoImpact is excellent, but for editing these objects or for creating new ones, the limitations soon become apparent.
Back To Layers
In comparison, the Photoshop system suddenly begins to look a lot more attractive. To edit the elephant layer to add the tusks and increase the size of the ears, for example, is simple so long as the protect transparency option on the layer palette is not selected. To add the cage layer in front of the animals is even easier, a simple case of selecting the new layer command and beginning to paint. What's more the Photoshop system is far more adaptable. If the elephant layer is duplicated before editing, for example, if the results are not what you were hoping for you can simply delete the layer and have another go.
This flexibility offered by layers is absolutely crucial as otherwise working with bitmaps can be a very unforgiving process. Once the values of a pixel have been changed there is no record of what they used to be and so no going back. Layers get around this in three main ways. In terms of features like transparency and image mode they allow non-destructive editing as the original pixel values are still retained. In terms of destructive editing they allow trial runs so that rather than painting on the layer itself, for example, you can paint on a new layer above and only merge the results if you are happy with the effect. Finally layers offer the ultimate undo as ongoing work can be saved as a duplicate hidden layer that can be restored if things go wrong.
This editing flexibility and the resulting creative freedom is taken onto new ground with Photoshop 4.0's latest innovation; adjustment layers. These are layers that act as lenses applying colour adjustments to all the layers below them in the stack. The beauty is that by double-clicking on the adjustment layer the effect can be fine-tuned so that a severe posterization effect, for example, can be retrospectively lessened. In other words processes that were previously permanent and destructive are now infinitely editable. Adobe clearly intends to widen the concept and eventually I expect to work with an original background image with every selection, adjustment, filter and even tool-based action available as an editable layer above.
That's the future, but even as they stand now, layers should be completely integral to successful photo-editing. In fact it is this editing flexibility rather than the compositional flexibility that is the most important benefit offered by layers. A recent practical example was converting a scanned photo into a Black Grape style CD cover. This involved copying the head, hair, face, nose and lips all onto their own layers where colorization and transparency effects were applied. In a way this wasn't a traditional photocomposition at all as none of the layers had to be repositioned. Theoretically all of the work could have been done on the single background layer, but without the ability to try out, edit and fine-tune the effects, the chances of getting an acceptable end result would have been minimal.
This appreciation and understanding of the editing benefits of layers is probably the single most obvious difference between the seasoned Photoshop user and the novice. For any serious work, the experienced user will undoubtedly have the layers palette open and even the simplest image will probably involve multiple layers. It's in this editing and creative freedom that the Photoshop layering system really shines, but its users are effectively left to work this out for themselves. By concentrating on the compositional use of layers as glorified acetate sheets Adobe isn't doing itself or its users any favours. The acetate sheet metaphor is a useful starting off point, but it's essential to understand that layers are far more than just simple compositional tools.
Ultimately, if it came down to a choice between the compositional attractions of the PhotoImpact and Image Composer object-based models and the creative flexibility of the Photoshop layering system I'd definitely stick with the latter. However, as we saw through the interchangability between Image Composer sprites and Photoshop layers, this is a completely false and unnecessary choice. The power of both systems could easily be enabled within the same program through the use of separate object and layer modes. Working in object mode - or more simply with an object tool - would be limited to a layer's non-transparent pixels and allow direct selection and handling on the image window while working in layer mode would allow the easy creation and editing of layers through the layer palette.
Such a system would offer object-based compositional power, layer-based editing flexibility and the unique bitmap-based ability for creative interaction between stacked pixel values. Suddenly it would be the vector-based drawing programs that would seem limited and old-fashioned compared to their photo editing counterparts.
Hopefully you've found the information you were looking for. For further information please click here.
For free trials and special offers please click the following recommended links:
For further information on the following design applications and subjects please click on the links below:
[3D], [3ds max], [Adobe], [Acrobat], [Cinema 4D], [Corel], [CorelDRAW], [Creative Suite], [Digital Image], [Dreamweaver], [Director], [Fireworks], [Flash], [FreeHand], [FrameMaker], [FrontPage], [GoLive], [Graphic Design], [HTML/CSS], [Illustrator], [InDesign], [Macromedia], [Macromedia Studio], [Microsoft], [NetObjects Fusion], [PageMaker], [Paint Shop Pro], [Painter], [Photo Editing], [PhotoImpact], [Photoshop], [Photoshop Elements], [Publisher], [QuarkXPress], [Web Design]
To continue your search on the designer-info.com site and beyond please use the Google and Amazon search boxes below:
|designer-info.com: independent, informed, intelligent, incisive, in-depth...|
All the work on the site (over 250 reviews, over 100 articles and tutorials) has been written by me, Tom Arah It's also me who maintains the site, answers your emails etc. The site is very popular and from your feedback I know it's a useful resource - but it takes a lot to keep it up.
You can help keep the site running, independent and free by Bookmarking the site (if you don't you might never find it again), telling others about it and by coming back (new content is added every month). Even better you can make a donation eg $5 the typical cost of just one issue of a print magazine or buy anything via Amazon.com or Amazon.co.uk (now or next time you feel like shopping) using these links or the designer-info.com shop - it's a great way of quickly finding the best buys, it costs you nothing and I gain a small but much-appreciated commission.
Thanks very much, Tom Arah
[DTP/Publishing] [Vector Drawing] [Bitmap/Photo] [Web] [3D]
[Articles/Tutorials] [Reviews/Archive] [Shop] [Home/What's New]