pytoshop.image_resources¶
The ImageResources
section.
Image resource blocks are the basic building unit of several file formats, including Photoshop’s native file format, JPEG, and TIFF. Image resources are used to store non-pixel data associated with images, such as pen tool paths.
-
class
pytoshop.image_resources.
AlphaIdentifiers
(name='', identifiers=[])[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
identifiers
¶ Alpha indentifiers
-
-
class
pytoshop.image_resources.
BackgroundColor
(name='', color_space=<ColorSpace.rgb: 0>, color=[])[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
Background color.
-
color
¶ The color data. If the color data does not require 4 values, the extra values are undefined and should be included as zeros.
-
color_space
¶ The color space. See
enums.ColorSpace
-
-
class
pytoshop.image_resources.
BorderInfo
(name='', border_width_num=0, border_width_den=1, unit=<Units.inches: 1>)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
Border information.
-
border_width_den
¶ Border width denominator
-
border_width_num
¶ Border width numerator
-
unit
¶ Unit. See
enums.Units
.
-
-
class
pytoshop.image_resources.
CopyrightFlag
(name='', copyright=False)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
copyright
¶ Is copyrighted?
-
-
class
pytoshop.image_resources.
DocumentSpecificIdsSeedNumber
(name='', base_value=0)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
base_value
¶ Base value
-
-
class
pytoshop.image_resources.
EffectsVisible
(name='', visible=False)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
visible
¶ Are effects visible?
-
-
class
pytoshop.image_resources.
GenericImageResourceBlock
(name='', resource_id=0, data=b'')[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
data
¶ Raw data of image resource.
-
resource_id
¶ Type of image resource.
-
-
class
pytoshop.image_resources.
GlobalAltitude
(name='', altitude=0)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
altitude
¶ Global altitude
-
-
class
pytoshop.image_resources.
GlobalAngle
(name='', angle=0)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
angle
¶ Global light angle for the effect layer
-
-
class
pytoshop.image_resources.
GridAndGuidesInfo
(name='', grid_hori=0, grid_vert=0, guides=[])[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
Grid and guides resource.
-
grid_hori
¶ Document-specific grid (horizontal). In 1/32 pt.
-
grid_vert
¶ Document-specific grid (vertical). In 1/32 pt.
-
guides
¶ Guides. See
GuideResourceBlock
.
-
version
¶
-
-
class
pytoshop.image_resources.
GuideResourceBlock
(location=0, direction=<GuideDirection.vertical: 0>)[source]¶ Bases:
object
-
direction
¶ Guide direction. See
enums.GuideDirection
.
-
location
¶ Location of guide in document coordinates.
-
-
class
pytoshop.image_resources.
ImageResourceBlock
[source]¶ Bases:
object
Stores a single image resource block.
pytoshop
currently doesn’t deeply parse image resource blocks. The raw data is merely retained for round-tripping.-
name
¶ Name of image resource.
-
classmethod
read
(fd, header)[source]¶ Instantiate from a file-like object.
Parameters: - fd (file-like object) – Must be readable, seekable and open in binary mode.
- header (PsdFile object) – An object to get global file information from.
-
resource_id
¶ Type of image resource.
-
-
class
pytoshop.image_resources.
ImageResourceUnicodeString
(name='', value='')[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
value
¶
-
-
class
pytoshop.image_resources.
ImageResources
(blocks=[])[source]¶ Bases:
object
The image resource block section.
-
blocks
¶ List of all
ImageResourceBlock
items.
-
-
class
pytoshop.image_resources.
LayersGroupInfo
(name='', group_ids=[])[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
Layers group information.
Indicates which layers are locked together.
-
group_ids
¶
-
-
class
pytoshop.image_resources.
PrintFlags
(name='', labels=False, crop_marks=False, color_bars=False, registration_marks=False, negative=False, flip=False, interpolate=False, caption=False, print_flags=False)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
Print flags.
-
color_bars
¶ color bars
-
crop_marks
¶ crop marks
-
flip
¶
-
interpolate
¶
-
labels
¶
-
negative
¶
-
print_flags
¶ print flags
-
registration_marks
¶ registration marks
-
-
class
pytoshop.image_resources.
PrintScale
(name='', style=<PrintScaleStyle.centered: 0>, x=0.0, y=0.0, scale=0.0)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
scale
¶
-
style
¶ Style. See
enums.PrintScaleStyle
.
-
x
¶ x location
-
y
¶ y location
-
-
class
pytoshop.image_resources.
Url
(name='', url=b'')[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
url
¶ URL
-
-
class
pytoshop.image_resources.
VersionInfo
(name='', version=0, has_real_merged_data=False, writer='', reader='', file_version=0)[source]¶ Bases:
pytoshop.image_resources.ImageResourceBlock
-
file_version
¶ file version
-
has_real_merged_data
¶ has real merged data?
-
reader
¶ reader name
-
version
¶
-
writer
¶ writer name
-