OptionalallowOptionalbaseBase path for reading source images. If not set, images must have their pixel data stored in extras._imageData as Uint8Array.
OptionaldirectInternal publish detail used by Unity binary output: allow single untrimmed PNG image packages to bypass the packer and write atlas0 directly, matching the reference CLI behavior.
OptionalencoderRaster backend, injected by the host adapter. Required for actual image compositing and trimImage.
import sharp from 'sharp';
await doc.transform(atlas({ encoder: sharp }));
OptionalextractInternal publish detail used by the direct-image-output path. When extractAlpha is enabled, the direct output shortcut must be disabled.
OptionalfastWhether to use the fast editor-compatible packing heuristics. Default: true.
OptionalmaxMaximum atlas texture size (width and height). Default: 2048.
OptionalmkdirOptional mkdir function to ensure output directory exists. If not provided, the outputPath directory must already exist.
OptionalmultiAllow spilling into multiple atlas pages. Default: true.
OptionaloutputOutput directory for generated atlas PNGs. Required when encoder is provided.
OptionalpackagesLimit atlas generation to specific package names. When omitted, all packages are processed.
OptionalpaddingPixel padding between sprites. Default: 1.
OptionalpowerConstrain atlas dimensions to powers of two. Default: false.
OptionalpreserveKeep original input order when MaxRects tie-break scores are equal. This is an internal publish detail used to mirror editor/CLI behavior.
OptionalreadOptional raw file reader for reading .jta MovieClip files. Required for MovieClip frame atlas packing.
OptionalseparatedWhen branchProcessing keeps branch resources, publish branch images into separate atlas pages/files per branch instead of mixing them with main.
OptionalsquareForce square atlas (width === height). Default: false.
OptionaltrimTrim transparent pixels from image edges before packing. Requires a raster backend. Stores offset/originalSize in Sprite nodes. Default: false.
Allow rotating sprites 90° for better packing. Default: true.