- Added
useRawDataproperty to read options, if it's set totruethe layer and mask image data will not be decompressed byreadPsdfunction. Instead it can be decompressed for individual layers usingdecodeLayerPixelsfunction.
- Fixes for importing ABR files
- Remove
createCanvasFromDataparameter frominitializeCanvasfunction, simplifying handling of custom canvas classes
- Fixed handling for
transformproperty invectorOriginationsection
- Added partial support for
pixelSourcesection - Reworked ABR brush types
- Added support for reading compressed patterns in ABR files
- Added support for reading and writing
chokeparameter for layer effects
- BREAKING CHANGE: Removed
layersGroupandlayerGroupsEnabledIdproperties fromimageResourcesand instead addedlinkGroupandlinkGroupEnabledfields to layers.
- Added support for read-only field
text.textPathwith text path information for text layers. This field is extracted from psd.engineData, which is not fully supported yet.
- Added support for
realMasksection
- Added support for
blendingRangessection - Added support for
interpolationMethodfor gradients
- Added support for
curvessmart object filter - Added support for reading and writing
palettefield - Added support for reading PSD file with palette color mode
- Fixed parsing for
filterEffectsMaskssection - Fixed padding for section data
- Fixed reading some fields in
compositorUsedsection - Fixed incorrect writing for some smart object filters
- Added support for perspective warp filter
- Fixed handling externally linked files in smart object layers
- Fixed parsing path
smoothgradient interpolation method - Changed
PsdReadertype
- Fixed parsing path
operationfield to handle empty value
- Fixed invalid value of
globalAnglewhen the value is negative
- Fixed missing handling for justified paragraphs
- Fixed reading slice names
- Improve performance of encoding and decoding large text fields.
- Added initial support for 32bit image data.
- Fixed handling compressed encoding mode by switching to better compression library.
- Added support for reading 16bit image data, when reading PSD width default settings 16bit data will be converted to regular 8bit canvases, when
useImageData: trueis passed in read options the image data will be of typeUint16Arrayfor 16bit images. Because of that type oflayer.imageDataandpsd.imageDataandlayer.mask.imageDatacan be of different types depending on PSD file bitDepth. - Added support for reading image data compressed with zip with prediction mode.
- Added support for layer comps (
psd.imageResources.layerCompsandlayer.compsfields)
- Fixed incorrect layer trimming when using
layer.imageDataproperty instead oflayer.canvas
- Added brush type to ABR
- Fixed importing smudge and mixer brushes from ABR
- Fixed saving mask without canvas/imageData
- Fixed rare issue with saving files resulting in corrupted file
- Fixed incorrect writing of
fillRulefield for vector paths
- Added
fillRulefield to vector paths
- Fixed broken file after saving with layer name longer than 255 characters
- Fixed incorrect parsing of external linked files
- Fixed incorrect parsing of compositorUsed section when some fields are missing
- Fixed saving smart layers without placedLayer.warp field present for newer versions of photoshop
- Added extra error checks and fixed writing PSD without placedLayer.warp field present
- Fixed issues with writing some layer effects
- Fixed incorrect reading and writing of slice bounds
- Fixed missing bounds and boundingBox fields on
layer.text
- Added
effectsOpenfield to layers - Added support for basic set of smart layer filters
- Changed the way smart layer filters are typed (
placedLayer.filter)
- Added support for different color modes in text layer colors
- Added option for other smart layer filter types
- Added support for smart layer puppet filter (
placedLayer.filter)
- Added handling missing
fontin text layer style by assuming first font on the list
- Added support for float color in effects, new color type was added
export type FRGB = { fr: number; fg: number; fb: number; }; // values from 0 to 1 (can be above 1)
- Changed
timefield onLinkedFilefromDatetostringtype
- Added support for frame and timeline animations
- Added support for zip compression without prediction of image data
- Added support for
compressoption when writing
- Added support for
layerMaskAsGlobalMaskflag - Added support for
interpolationMethodfor gradient overlay layer blending mode
- Fixed handling files with incorrect channel image data length
- Fixed corrupted file when passing non-integer values to
layer.left,.top,.right,.bottom
- Fixed reading some corrupted files
- Fixed handling files with incorrect section sizes
- Fixed incorrect writing of
vogksection in some cases resulting in a broken file
- Fixed incorrect writing of
vogksection in some cases resulting in a broken file
- Added
nonAffineTransformfield to smart object transform when nonAffineTransform is diferent than regular transform
- Fixed writing paragraphStyle autoLeading property (previous it was writing incorrectly for whole values, like 1.0 or 2.0)
- Added support for
fillOpacityandtransparencyShapesLayer - Fixed error in some cases when reading files with deeply nested layers
- Added
readCshfunction for reading photoshop custom shape files
- Added support for
imageReadyVariablesandimageReadyDataSetsimage resources - Fix missing support for alternative image resource block signatures
- Added missing handling for new platform and platformLCD text anti-aliasing modes
- Added handling for annotations
- BREAKING CHANGE: Fixed reading and writing non-RGB colors and documented value ranges (value ranger for HSB, CMYK, Lab and Grayscale colors different from previous versions)
export type RGBA = { r: number; g: number; b: number; a: number; }; // values from 0 to 255 export type RGB = { r: number; g: number; b: number; }; // values from 0 to 255 export type HSB = { h: number; s: number; b: number; }; // values from 0 to 1 export type CMYK = { c: number; m: number; y: number; k: number; }; // values from 0 to 255 export type LAB = { l: number; a: number; b: number; }; // values `l` from 0 to 1; `a` and `b` from -1 to 1 export type Grayscale = { k: number }; // values from 0 to 255 export type Color = RGBA | RGB | HSB | CMYK | LAB | Grayscale;
- Fixed not handling correct value for text gridding
- Fixed error when opening PSB file with smart objects
- Fixed reading layer groups with missing section divider info
- BREAKING CHANGE: Changed how
meshPointsare represented in warps
// old representation
interface Warp {
meshPoints: { type: 'horizontal' | 'vertical'; values: number[]; }[];
}
// new representation
interface Warp {
meshPoints: { x: number; y: number; }[];
}- Fixed handling for complex warps
- Fixed incorrect length of style and paragraph style runs when reading or writing
- Added handling for
pathSelectionState
-
Added support for reading and writing PSB files (Large Document Format)
Use
psb: truein write options to write file in PSB format)The sizes are still limited by 32bit integer number range and will throw an error if you attempt to read any file larger than 2GB.
-
Fixed some fields not handled in
vectorOrigination
-
BREAKING CHANGE: Added support for multiples of the same layer blending effect, these
layer.effectskeys are now arrays:dropShadowinnerShadowsolidFillstrokegradientOverlay
WARNING: adding more than one of effect in these arrays will result in file being saved with new version of effects section that is not readable on older versions of Photoshop.
- Fixed smart layer block info not parsing correctly in some cases
- Added automatic deduplication of layer IDs
- Fixed group blending modes not writing correctly
- Added
fromVectorDatafield tomaskobject that indicates if mask image data comes from vector data attached to the layer - Added handling
globalLayerMaskInfofield - Fixed vector and bitmap masks not writing correctly when used at the same time on one layer
- Added missing field
operationto paths in vector layers
- Added
noBackgroundwrite option to force treating bottom layer as layer instead of background when it doesn't have any transparent pixels
- Added handling for artboards
- Fixed issues with handling smart objects
- Fixed issues with handling vector layers
- Added handling for Vector Origination Data and Compositor Used
- Added handling for ICC Untagged Profile
- Added handling for Lock Artbords layer option
- Added handling for smart objects
- Changed types for text warp
- Added handling for text shape (point, box)
- Fixed incorrect parsing of utf-16 strings
- BREAKING CHANGE: Changed all color fields from r, g, b, a array to color mode specific objects
// old var color = [red, green, blue, alpha]; // new var rgbColor = { r: red, g: green, b: blue }; var hsbColor = { h: hue, s: saturation, b: brightness }; var labColor = { l: L, a: A, b: B }; var cmykColor = { c: cyan, m: magenta, y: yellow, k: black }; var grayscaleColor = { k: grayscaleValue }; // reading new colors if ('r' in color) { // read RGB color } else if ('h' in color) { // read HSB color } else if ('l' in color) { // read Lab color } else if ('c' in color) { // read CMYK color } else { // read grayscale color } // almost all color in PSD document follow main document color mode, so you can use this shortcut in your code if ('r' in color) { // read RGB color } else { // error or use default }
- BREAKING CHANGE: Removed
unicodeAlphaNamesimage resource (usealphaChannelNamesinstead) - BREAKING CHANGE: Replaced
sheetColorslayer field withlayerColorfield - BREAKING CHANGE: Changed mask density fields to be in 0-1 range (instead of 0-255)
- Removed
metadatafield from layers - Fixed incorrectly writing layer masks information in some cases
- Added handling for adjustment layers
- Added
timestampfield to layers - Added
printInformationimage resource
- Fixed saved PSD files broken in some cases
- Added missing support for "stroke" blending option
- BREAKING CHANGE: Changed some numerical fields in effects objects to value+units fields
- Added handling for vector layers
- Added option for reading and writing raw image data using
imageDatafields corresponding tocanvasfields on layer objects. (useuseImageDataoption for reading raw data instead of using canvas objects, for writing initializeimageDatafields instead ofcanvasfields) - Added option for reading and writing raw, compressed thumbnail image data using
thumbnailRawfield. (useuseRawThumbnailoption for reading raw data instead of using canvas object) - Added
backgroundColorimage resource - Added
xmpMetadataimage resource - Added
printFlagsimage resource - Added
idsSeedNumberimage resource - Added typescript type for blendModes
- Fixed writing incorrect binary data in some cases
- Fixed field name for
sectionDivider.subType - Fixed reading mask parameters
- Added handling for reading and writing text layer data (with some limitations)
- Added
invalidateTextLayerswrite options for forcing Photoshop to redraw updated text layer. - Removed unnecessary
versionfields frompixelAspectRatioandversionInfoimage resources.
- BREAKING CHANGE: Normalized handling of opacity (now all opacity fields are in 0-1 range, instead of 0-255)
- BREAKING CHANGE: Fixed handling for colors (colors are now represented by an array of 4 values in 0-255 range as [R, G, B, A], for example:
[255, 0, 0, 255]for opaque red color) - Added handling for layer effects (blending options) (supports all effects except "Pattern Overlay")
- Added
writePsdUint8Arrayfunction for saving toUint8Array(this avoids double memory allocation) - Removed unnecessary
versionfield fromgridAndGuidesInformationfield
- Added exported byteArrayToBase64 function
- Updated readme with exampla of usage in web worker
- Added print scale image resource handling
- Added caption digest image resource handling
- Added loading and saving layer masks
- Changed reading to ignore not implemented features by default instead of throwing
- Removed logging missing handling for layer info
- Added
throwForMissingFeaturesandlogMissingFeaturesread options for previous behavior
-
Simplified canvas initialization on NodeJS
before:
import { createCanvas } from 'canvas'; import { readPsd, initializeCanvas } from 'ag-psd'; initializeCanvas(createCanvas);
after:
import 'ag-psd/initialize-canvas'; import { readPsd } from 'ag-psd';
-
Changed
writePsd()method to always returnArrayBuffer. If you needBufferas a result usewritePsdBuffer()method instead. -
Simplified script import on browser, now import is the same on both platforms.
before:
// node import { readPsd } from 'ag-psd'; // browser import { readPsd } from 'ag-psd/dist/browser';
after:
// node or browser import { readPsd } from 'ag-psd';