Photopea reference · Chapter 09

Automation and animation

Actions and ATN files, the scripting API including the objects that matter, the iframe plugin protocol, batch processing, and the frame animation model with its layer-name convention.

Independent referenceUpdated 4 November 202612 min readReviewed by the photoedit.in editorial team

Chapter 09 · Automation & animation

Automation is where a browser editor is usually weakest, and Photopea is better than expected here without being strong. It records and replays actions in Photoshop's ATN format, runs JavaScript with an API close enough to Photoshop's that many existing scripts work, defines variables for generating document variants, converts formats in batches, and supports a web-based plugin system that can extend the editor. Animation, by contrast, is deliberately minimal: frames are defined by layer naming rather than a timeline, and there is no tweening.

Actions

The Actions panel records, stores and replays editing steps. The hierarchy is the same as Photoshop's: action sets contain actions, and actions contain steps. The panel provides record, apply, new set, new action, delete and export controls, and it saves and loads ATN files, which means actions built in Photoshop can be imported and run here.

That compatibility is more valuable than it first appears. A studio with a decade of recorded actions — watermarking, batch resizing, contact-sheet generation — can carry them across to Photopea and keep using them. Each ATN file loads as one action set, and loading is done through File > Open like any other resource.

The limitation is coverage. Not every Photopea operation can be recorded. All adjustments and filters are supported, which covers the majority of batch-able work, but tool operations and some interface actions are not. The developer has stated that more coverage is planned without giving a timeline. If your action depends on a specific tool behaviour rather than an adjustment or filter, test it before relying on it.

Scripts

Scripts are written in JavaScript and run from File > Script. The API deliberately mirrors Adobe's Photoshop scripting interface, so many existing Photoshop scripts are reusable with little or no modification. That is a significant compatibility decision, and it is the reason Photopea can claim a scripting story at all rather than starting from nothing.

Scripts persist in browser local storage, accessible from Edit > Local Storage, so a script you write stays available in that browser profile. They can also be executed through the Photopea API, which is how embedded integrations drive the editor programmatically.

Photopea extends the Photoshop model with several functions that only make sense in a browser context. App.open(url, as, asSmart) opens a file from a URL. App.echoToOE(string) sends a string to the outer environment, which is how an embedding page receives results. App.showWindow(string) shows a panel or window, and App.UI gives access to interface elements. Document.saveToOE("png") saves to the outer environment, and Document.clearHistory() releases memory, which matters in a browser where a long history can consume a lot of RAM.

Scripts that create files return a ZIP

If a script produces more than one output file, Photopea returns a ZIP archive rather than prompting for each file. That is a sensible browser-era decision, but it surprises people who expect a save dialog per file. Plan your script to name its outputs clearly, because the user receives them as a bundle.

Variables and batch work

File > Variables lets you define variables and supply a spreadsheet of values to generate multiple document variants from one template. This is the classic use case for personalised certificates, badges, business cards or social posts: design once with a placeholder, supply a CSV, and produce one document per row. It is a niche feature, but for the people who need it, it is the difference between an afternoon and a week.

File > Automate > Convert Formats handles batch format conversion in the browser with no upload, accepting mixed source formats and returning a ZIP. Scripts can go further through the Storages API, which the documentation describes as capable of processing hundreds of gigabytes of files in a single click by working through a cloud storage backend rather than local files. That is an unusual capability for a browser tool and it is the closest Photopea comes to a proper batch pipeline.

Plugins

The plugin system is web-based rather than native. Window > Plugins lists installed plugins and offers an Add Plugin button. A plugin is described by a JSON configuration with name, URL, icon, width and height fields, and it opens as an iframe panel inside Photopea.

Communication happens through postMessage-based live messaging. A plugin can execute scripts in the host editor, send ArrayBuffers containing images, brushes, fonts or patterns into Photopea, or request the current document in a specified format. Drag and drop from the plugin iframe to the canvas is supported. Plugins can be commercial, with sign-in and payment handled inside the iframe, and they can be published to a public gallery through the Add Plugin interface. Icon conventions are documented too: transparent background, black artwork, and a === URL prefix so Photopea can recolour the icon to match the interface theme.

What this is not is native plugin support. Photoshop's .8bf plugins are compiled native code and cannot run in a browser sandbox. The developer confirmed in January 2024 that supporting them would require a virtual machine for native code and months of work, and closed the issue. For anyone whose workflow depends on a specific commercial plugin — a particular sharpening algorithm, a specialised importer, a niche filter — this is a hard stop, not an inconvenience.

Animation

Photopea opens, edits and saves animated GIF, APNG and WebP files. The frame system, however, is a layer-naming convention rather than a timeline, and understanding it takes about thirty seconds.

Any layer whose name begins with _a_ defines an animation frame. On export, Photopea scans the document in order, finds every _a_ layer, and turns each one into a sequential frame. Layers that do not begin with _a_ are visible in every frame, which is how you build a persistent background. The default frame delay is 100 milliseconds, and you can override it per frame by appending a comma and a duration to the layer name, so _a_frame1,250 produces a 250 millisecond frame. Frames can be any layer type, including groups and smart objects.

TaskHow it works
Create a frameName a layer with the _a_ prefix
Set frame durationAppend ,N where N is milliseconds
Persistent backgroundLeave the layer name without the prefix
Open an existing animationPhotopea converts each frame into a correctly named layer
Combine two animationsPut each animation's frames in a folder, then Layer > Animation > Merge

When you open an animated GIF, APNG or WebP, Photopea converts each frame into a layer with the proper _a_ name, so an existing animation is editable frame by frame. To compose two animations that should play simultaneously, you place each animation's frames in its own folder and use Layer > Animation > Merge, which interleaves the frame layers across folders.

The limitation is fundamental rather than cosmetic. There is no visual timeline, no keyframe interpolation, no tweening and no onion skinning. It is a frame-by-frame system controlled by naming, which is workable for a short GIF banner and unsuitable for any real animation production. If you need motion graphics, use a motion tool.

What this chapter means in practice

For a free browser editor, the automation story is surprisingly complete: ATN compatibility, Photoshop-compatible scripting, variables, batch conversion and a working plugin architecture. The hard limits are native plugins, which will never work without a virtual machine, and animation, which is a convenience rather than a production capability. Both belong in the decision guide rather than in a list of complaints, because they affect specific job categories rather than general use.