Search Docs
Loading...
Skip to content

Supported File Formats for Import (Node.js)

When building server-side creative applications with CE.SDK in Node.js, understanding which file formats you can import is essential for processing user content at scale. @cesdk/node supports the same comprehensive range of modern media formats as the browser version, with one limit for video: only its native engine decodes video. The WASM engine loads a video file, but it decodes no video frame in Node.js.

This guide provides a complete reference of supported file formats for importing media, templates, and fonts into CE.SDK on Node.js.

Supported Import Formats#

CE.SDK for Node.js supports importing the following media types:

Category Supported Formats
Images .png, .apng, .jpeg, .jpg, .gif, .webp, .svg, .bmp
Video .mp4 (H.264/AVC, H.265/HEVC), .mov (H.264/AVC, H.265/HEVC), .webm (VP8, VP9, AV1)
Audio .mp3, .m4a, .mp4 (AAC or MP3), .mov (AAC or MP3), .webm (Opus or Vorbis)
Animation .json (Lottie), .lottie (dotLottie)
Templates .idml (InDesign), .psd (Photoshop), .scene (CE.SDK Native)

A Lottie .json file or a dotLottie .lottie archive set as a video fill plays as one block. To import a Lottie as editable blocks, use the @imgly/lottie-importer package: LottieImporter.fromJSON() takes the text of a .json file, LottieImporter.fromFile() the bytes of a .json or .lottie file, and LottieImporter.fromURL() its URL. See Import Lottie Animations.

Video and Audio Codecs#

While container formats (.mp4, .mov, .webm) define how media is packaged, codecs determine how the content is compressed. CE.SDK for Node.js supports the following codecs:

Video Codecs#

Only the native engine of @cesdk/node decodes video in Node.js. It decodes H.264 and HEVC with the system’s media libraries, such as GStreamer on Linux and Media Foundation on Windows, and VP8, VP9 and AV1 with codecs it bundles. The WASM engine loads a video file, but it decodes no video frame in Node.js.

  • H.264 / AVC (in .mp4 or .mov) – Decoded by the native engine
  • H.265 / HEVC (in .mp4 or .mov) – Decoded by the native engine where the system supports it; availability varies by system libraries
  • VP8, VP9, AV1 (in .webm) – Decoded by the native engine with codecs it bundles

Audio Codecs#

  • MP3 (in .mp3 files or within .mp4/.mov containers)
  • AAC (in .m4a, .mp4, or .mov containers)
  • Opus, Vorbis (in .webm containers)

Size Limits and Constraints#

CE.SDK for Node.js processes media using the system’s available resources. Server environments typically have more memory and CPU resources than browsers, but you should still be mindful of limits:

Image Resolution Limits#

Constraint Recommendation / Limit
Input Resolution Maximum input resolution is 4096×4096 pixels by default. Images from external sources are resized to this size before rendering. You can modify this value using the maxImageSize setting.
Output Resolution There is no enforced output resolution limit. The editor theoretically supports output sizes up to 16,384×16,384 pixels. Practical limits depend on available system memory and CPU resources.

All image processing in CE.SDK for Node.js is handled server-side. The native engine of @cesdk/node renders on the GPU when one is available and falls back to CPU rendering. The WASM engine renders on the CPU (no GPU required). The default limit of 4096×4096 ensures reasonable processing times and memory usage. Higher resolutions will work but may require more memory and longer processing times.

Video Resolution and Duration Limits#

Constraint Recommendation / Limit
Resolution Up to 4K UHD is supported for processing, depending on available system resources. Maximum video size is bounded by available system memory; with the WASM engine it is additionally bounded by the 32-bit address space of WebAssembly (wasm32).
Frame Rate 30 FPS at 1080p is recommended; 60 FPS works but increases processing time
Duration Stories and reels of up to 2 minutes process efficiently. Longer videos up to 10 minutes are supported, with processing time scaling proportionally with duration.

Format-Specific Considerations#

SVG Limitations#

CE.SDK uses Skia for SVG parsing and rendering. While most SVG files render correctly, there are some important limitations to be aware of:

Text Elements#

  • Text draws in a font of its font-family when the scene or a font asset source has one, in the closest weight and style.
  • Any other family draws in the engine’s default font, so the text keeps its position but may look different. Convert text to paths in your vector editor when its exact look matters.
  • Only the first entry of a font-family list counts, and later entries never match. Roboto, Arial, sans-serif looks for Roboto, then uses the default font. A generic first entry is the exception: serif, monospace and cursive draw in Source Serif Pro, Source Code Pro and Caveat when a font asset source has them.
  • SVG text uses the fallback fonts of text blocks. An emoji draws in the emoji font (defaultEmojiFontFileUri). Another character that the font does not have draws in fallbackFontUri, or in an IMG.LY hosted fallback font when useSystemFontFallback is on. A character that no fallback font has draws as the missing-character mark of the font. Arabic and Hebrew text draws from right to left.
  • Text in an SVG cannot be edited. It draws as part of the image.

Styling Limitations#

  • CSS rules in <style> elements apply to type, class and ID selectors, *, combinations of these such as rect.logo, descendant and child combinators, and comma-separated lists of them. Rules inside @media screen and @media all apply too.
  • CSS rules with attribute selectors, pseudo-classes or sibling combinators, media queries with features or not, and other at-rules, are ignored – use presentation attributes instead.
  • A file whose CSS rules would need more than about 33 million matching steps fails to load.
  • RGBA color syntax is not supported – use fill-opacity and stroke-opacity attributes.
  • When exporting SVGs from design tools, choose the “presentation attributes” option.

Unsupported SVG Elements#

The following SVG elements are not supported:

  • Animation elements (<animate>)
  • Foreign object (<foreignObject>)
  • Text-related elements (<altGlyph>, <font>, <glyph>)
  • Script elements (<script>)
  • Some filter elements (<feComponentTransfer>, <feConvolveMatrix>, <feTile>, <feDropShadow>)
  • Inlined SVGs via <image> or <feImage> elements

WebP Support#

WebP images are fully supported for import in Node.js environments. CE.SDK handles both lossy and lossless WebP formats, including images with transparency (alpha channel). WebP provides excellent compression with high quality, making it ideal for optimizing storage and bandwidth in server applications.

Animated Image Considerations (GIF and APNG)#

CE.SDK handles animated GIF and APNG files based on scene type:

  • Design scenes: rendered as a static image showing the first frame.
  • Video scenes: imported as a looping video fill, with frame timing and duration parsed from the file’s metadata.

For complex animated content in server environments, prefer .mp4, which offers better compression and broader codec support. If you need to extract every frame from a GIF or APNG, process the file frame-by-frame outside of CE.SDK.

Template Format Details#

CE.SDK supports importing templates from popular design applications:

  • IDML (InDesign Markup Language) – Import layouts and designs created in Adobe InDesign
  • PSD (Photoshop Document) – Import layered Photoshop files with preserved layer structure
  • SCENE – CE.SDK’s native scene format, optimized for fast loading and processing

When importing IDML or PSD files in Node.js, CE.SDK preserves layer hierarchy, text formatting, and design structure where possible. Some advanced effects or features specific to the source application may require manual adjustment after import.

Font Format Support#

CE.SDK for Node.js supports modern font formats for typography:

Format Description
.ttf TrueType Font
.otf OpenType Font
.woff Web Open Font Format
.woff2 Compressed Web Open Font Format 2

Best Practices for Node.js#

Format Selection#

When building server-side applications, consider these format recommendations:

  • Images: Use .webp for optimal storage efficiency. Use .png for lossless images with transparency or .jpeg for photographs.
  • Video: Prefer .mp4 with H.264 encoding for maximum compatibility across deployment environments.
  • Audio: Use .mp3 for universal compatibility or .m4a (AAC) for better quality at smaller file sizes.
  • Templates: Use .scene format for CE.SDK-to-CE.SDK workflows to minimize parsing overhead.

Validation and Error Handling#

Always validate file formats before processing on the server:

  1. Check file signatures (magic bytes) not just extensions – users may upload misnamed files
  2. Validate MIME types from uploaded content
  3. Set maximum file size limits to prevent resource exhaustion
  4. Implement timeouts for processing operations to prevent hanging requests
  5. Log validation failures for debugging and security monitoring

Resource Management#

For production Node.js deployments, implement proper resource management:

  • Memory limits: Monitor and limit memory per process (note that --max-old-space-size caps only the V8 heap, not the engine’s own allocations)
  • Concurrency control: Limit concurrent processing jobs to prevent resource exhaustion
  • Cleanup: Always dispose of resources after processing (call dispose() on engine instances)
  • Queue systems: Use job queues (Bull, BullMQ) for long-running video processing tasks
  • Progress tracking: Implement progress callbacks for long operations
  • Caching: Cache processed assets when appropriate to reduce redundant processing

File System Considerations#

When working with local files in Node.js:

  • Use absolute paths or resolve paths relative to your application root
  • Clean up temporary files after processing
  • Consider streaming large files instead of loading them entirely into memory
  • Handle file permissions correctly for both reading source files and writing exports

Checking Support in the Running Engine#

Use engine.editor.getFileFormats() to read the media formats available to the current engine. It reflects feature flags, license restrictions, and measured codec capabilities without fetching files or starting codec probes. Re-read it when those settings or capability results change.

Use engine.editor.checkFileSupport() to inspect a particular resource URI. The result has separate image, audio, and video uses, each with a status and a machine-readable reason. A container can support audio even when video is disabled. Resource load failures and invalid recognized native-media headers or containers raise structured engine errors. Unknown or foreign formats return unsupported uses without validating that content.

  • supported: the inspection found a supported path for that use.
  • unsupported: the format, retained codec, feature, or license prevents that use.
  • unchecked: the engine lacks measured decoder evidence.
  • pending: a required capability probe is still running.

The inspection field is format for catalog entries and metadata for concrete file checks. Metadata inspection validates headers or retained container tracks. It does not decode every pixel, frame, or sample, or guarantee all codec profiles and levels. Container parsing can discard unsupported source tracks; the result describes the tracks retained by the engine.

MIME recognition alone does not establish media support. Editable-design importers, such as PDF or PSD packages registered by your application, remain separate from these native media uses. Scene, archive, font, and animation workflows also have their own entry points.

See Retrieve MIME Type for runnable examples of the catalog and concrete resource checks.