UPDATE - This subject was added to our documentation. Please see - https://cloudinary.com/documentation/image_transformations#deliver_selected_layers_of_a_psd_image
The answer to this question is of course - Yes.
When dealing with multi-layered PSD files, the
page parameter (
pg_ within URLs) allows referring to a specific layer in context of transformation.
When using this flag,
pg_1 will show all the layers together,
pg_2 will only show the first layer,
pg_3 will show the next layer, and so on. All layers are also shown by default when omitting the
page parameter completely.
In order to create a transformation that shows multiple selective layers (not all of them), layer transformations must be used. For example, here's a PSD file showing 2 strawberries using 4 layers (each strawberry has its shadow on a separate layer):
And here it is as again rendered by Cloudinary as a PNG:
In case you would like to show only the right strawberry (layer #2):
In case you would like to show only the right strawberry along with its shadow, you will be extracting the shadow and adding the strawberry as an overlay (
l_ within URLs) while referencing the necessary layer number using the
The next step (a bit more advanced) would be to place both objects in its authentic locations as it was on the original PSD file:
Here we used some advanced image characteristics
provided by the transformation mechanism:
ih = initial width/height respectively
h = layer's width/height respectively
py = original x & y position coordinates
In this example the base image (right-hand shadow) is positioned in its original coordinates and padded to its initial dimensions based on the PSD canvas.
The right strawberry is then added as overlay, padded to the right dimensions based on the layer size and coordinates and positioned correspondingly.
The last example shows both strawberries while excluding their shadows:http://res.cloudinary.com/demo/image/upload/pg_3,c_lpad,w_iw,h_ih,x_px,y_py,g_north_west/l_strawberries,pg_5,c_lpad,w_w_add_px,h_h_add_py,x_px,y_py,g_north_west/g_north_west,fl_layer_apply/strawberries.png
It uses the same transformation directives as the former example to place back the objects to their original location, using the right-hand strawberry as the base and left strawberry as the overlay.