How to check background layer color from psd file

Can we discuss few requirements over call related to PSD

  • How to find background color of psd? Is there specific background layer in psd?
  • Can we change the position of image,text in psd?
  • Can we change background color of text layer?

@Dharmpal

  1. Some PSD files contain Background Layer, some don’t. To find if there is background layer you need to check if it the first one and with the method like this:

bool isBackground = backgroundLayer.getLayerLock() == LayerLockType.LockImagePixels;

  1. Here is the code that works for any type of layers:

int top = 100;
int left = 100;
int height = layer.getHeight();
int width = layer.getWidth();
layer.setTop(top);
layer.setLeft(left);
layer.setBottom(layer.getTop() + height);
layer.setRight(layer.getLeft() + width);

  1. PSD Files don’t support Background for Text Layers, but you can create your own separate layer and use it as background. Aspose.PSD has a good support of all kinds of layers except of ArtBoard Layer - Aspose.PSD for Java - API Reference
    But the ArtBoard will be also released soon.