DEV Community

ahmed isam
ahmed isam

Posted on • Originally published at codexpetgenerator.com

Codex Pet Image Formats: JPG, PNG, or WebP?

--
title: "Codex Pet Image Formats: JPG, PNG, or WebP?"
description: "What image formats work for Codex pets? Short answer: the final pet is always spritesheet.webp. Here's how JPG, PNG and WebP compare as source images, and the upload size rules."
tags: [codex, webp, pixelart, tutorial]

canonical_url: https://codexpetgenerator.com/blog/codex-pet-image-formats-jpg-png-webp

The codex pet image format question gets asked a lot, and the answer is shorter than people expect: Codex reads one file, spritesheet.webp, from a subfolder of ~/.codex/pets. That is it. The spritesheet is a WebP grid of animation frames, and pet.json tells Codex how to slice it.

Your source image can be JPG, PNG or WebP. The pet that ends up on your desktop is always WebP.

JPG vs PNG vs WebP for pixel pets

  • JPG is lossy, and lossy compression blurs the sharp edges pixel art depends on. Fine for photos, worst for pixel sources.
  • PNG is lossless. Hard edges stay hard, transparency works. Safest source format.
  • WebP sits in the middle as a source, but it is the only output format that matters, since it is what Codex loads.

What the generator does

Generators like PetGen accept JPG, PNG and WebP as input, convert the image into a pixel-art grid, and export a ZIP containing spritesheet.webp plus pet.json. You never convert by hand. Practical takeaway: pick the cleanest source you have, PNG preferred.

Upload size rules

Keep it under 10MB. Over that, resize the long side to 1024 or 2048px. A 2048px PNG of a cartoon character is typically a few hundred KB, nowhere near the cap. Compression costs almost nothing for pixel art, because it is simple geometry.

Full guide with FAQ: https://codexpetgenerator.com/blog/codex-pet-image-formats-jpg-png-webp

中文操作指引

Top comments (0)