Images · verktøy

Lag spritesheet

Velg bilderammer, angi felles rammestørrelse og antall kolonner, og lag et spritesheet med nedlastbare koordinater.

Kjøres i nettleseren. Ingen opplasting.

Images stay on this device. They are not uploaded.

Choose up to 128 PNG, JPG, WebP, GIF, AVIF or BMP images. The first frame of an animated image is used. Processing speed depends on your device.

    Choose image files to begin.

    Om verktøyet

    Lag spritesheet sem complicação.

    Bilder behandles bare i nettleseren. Arket kan inneholde opptil 128 rammer; inndata- og utdatafilstørrelser begrenses av nettleserminne og canvas-støtte. Animerte filer bruker første dekodede ramme. Ingen bilder lastes opp.

    Veiledning

    Slik bruker du Lag spritesheet

    The Sprite Sheet Maker packs several small images into one picture, laid out in a grid. Choose your frames, set one frame size, the number of columns, the gap and the outer padding, then create the sheet. You get a PNG preview you can save, a JSON file with every frame position, and ready-made CSS lines. It is made for game art and web icons. It does not animate frames, remove backgrounds or compress the picture.

    Slik gjør du

    1. Press Choose image frames and pick 1 to 128 images (PNG, JPG, WebP, GIF, AVIF or BMP). Use the up and down arrows next to a file to change the frame order.
    2. Check the frame width, frame height and columns. The tool fills them from your first image and a roughly square grid, and you can change them.
    3. Set the gap between frames and the outer padding in pixels, or leave them at 0.
    4. Press Create sprite sheet. The preview and the size message appear if the settings fit.
    5. Press Download sprite PNG, Download coordinates JSON or Copy CSS coordinates. If you change the frame order, create the sheet again first.

    Eksempler

    Four 64 by 64 frames in two columns

    Du skriver inn
    Rammer
    4 images, each 64 x 64
    Rammebredde
    64
    Rammehøyde
    64
    Kolonner
    2
    Mellomrom
    0
    Marg
    0
    Du får
    Ark
    128 × 64 piksler
    Ramme 2
    x 64, y 0
    Ramme 3
    x 0, y 64

    Frames fill each row from left to right. Two columns of 64 pixels make 128 wide, and two rows make 128 tall. This layout was computed with the tool's own layout function, not with real files in a browser.

    Ikke kjørt med verktøyet. Se på dette som en illustrasjon.

    Six 32 by 32 frames with gap and padding

    Du skriver inn
    Rammer
    6 images, each 32 x 32
    Rammebredde
    32
    Rammehøyde
    32
    Kolonner
    3
    Mellomrom
    2
    Marg
    4
    Du får
    Ark
    108 x 74 pixels, 2 rows
    CSS
    .sprite-frame-2 { width: 32px; height: 32px; background-position: -38px -4px; }

    Width is 4 + 4 padding, plus 3 frames of 32 and 2 gaps of 2, which is 108. Height is 8 + 64 + 2, which is 74. Frame 2 starts at x 38 because 4 + 32 + 2 = 38. Computed with the layout function only.

    Ikke kjørt med verktøyet. Se på dette som en illustrasjon.

    Frames of different sizes are shrunk to fit

    Du skriver inn
    Rammer
    a 100 x 50 image and a 200 x 200 image
    Rammebredde
    64
    Rammehøyde
    64
    Kolonner
    2
    Du får
    Ark
    128 x 64 pixels
    Første ramme tegnes som
    64 x 32 at y 16
    Andre ramme tegnes som
    64 x 64

    Each image is scaled down to fit inside its 64 by 64 cell and centred, and is never scaled up. The wide image gets 16 empty pixels above and below. Computed with the layout function only.

    Ikke kjørt med verktøyet. Se på dette som en illustrasjon.

    More columns than frames is rejected

    Du skriver inn
    Rammer
    4 images
    Rammebredde
    64
    Rammehøyde
    64
    Kolonner
    5
    Du får
    Melding
    Enter valid frame size, columns, gap and padding.

    Columns cannot be higher than the number of images. Choose 4 or fewer for 4 frames.

    Ikke kjørt med verktøyet. Se på dette som en illustrasjon.

    Når det er nyttig

    • Pack the frames of a small game character into one file so the game loads a single image.
    • Combine a set of web icons into one picture for a CSS background technique.
    • Prepare a tile set or a row of animation frames for a game engine that reads a grid.
    • Get exact x and y positions for each frame as JSON for a script or a tool.
    • Reorder frames quickly and rebuild the sheet to test a different order.
    • Make a quick contact sheet of same-size thumbnails.

    Begrensninger

    • You can use from 1 to 128 images, and each image can be at most 8192 pixels on a side.
    • The finished sheet can be at most 8192 pixels wide or tall and at most 16,000,000 pixels in total. Gap and padding can each be at most 128 pixels.
    • All source images together are limited to 50,000,000 pixels, and large sets depend on your device memory.
    • Only the first picture of an animated GIF or similar file is used.
    • Every frame gets the same cell size. Images are shrunk to fit but never enlarged, and the tool does not trim empty space, remove backgrounds or pack frames tightly.
    • This was checked by reading the code and the page, not by uploading files, so test the PNG in your own project.

    Tips

    • Make all frames the same size before you start. Then no scaling or centring is needed.
    • Name the files in the order you want, for example frame-01.png, so the frames start in the right order.
    • Keep the CSS note at the top of the copied text. It tells you to set the element background image to the downloaded PNG.
    • Add a gap of a pixel or two if you see neighbouring frames bleeding into each other in the browser.

    Kilder

    Vanlige spørsmål

    Sobre Lag spritesheet.

    What is a sprite sheet?

    It is one image that holds many smaller pictures in a grid. A game or a web page loads the single file and then shows only one frame at a time by choosing which part of the picture to display.

    Which file types can I use?

    PNG, JPG, WebP, GIF, AVIF and BMP are accepted, up to 128 files. Any other type triggers a message asking you to use one of those. Whether a file opens also depends on what your browser can decode.

    Does it use an animated GIF as many frames?

    No. For an animated file, only the first decoded picture is used. To use every frame of an animation, save the frames as separate images first and choose them all.

    What do the coordinates JSON and CSS contain?

    The JSON lists the sheet size, frame size, columns, rows, gap, padding and, for each frame, its name, x, y, width, height and original size. The CSS gives one class per frame with a width, a height and a negative background position.

    What do gap and padding do?

    Gap is the empty space between frames. Padding is the empty border around the whole grid. Both are in pixels and both increase the final sheet size, so a big value can make the sheet too large.

    Why do I see an error that the sheet would be too large?

    The sheet would pass 8192 pixels on a side or 16 million pixels in total. Lower the frame size, use more columns for a tall sheet, or reduce padding and gap, and try again.

    Are my images uploaded?

    No. The images are read and drawn on a canvas inside your browser, and they stay on your device. The PNG, JSON and CSS are made locally.

    Can it save a smaller or compressed PNG?

    It saves a plain PNG from the canvas and gives no compression or quality setting. Use an image compression tool afterwards if file size matters to you.

    How is it different from a collage maker?

    A collage is for looking at. A sprite sheet uses fixed equal cells and gives you exact positions, so a program can find each frame. This tool is built for that second purpose.

    Hvordan bruker du Spritesheet-generator?

    Velg bilderammer, angi felles rammestørrelse og antall kolonner, og lag et spritesheet med nedlastbare koordinater.

    Lastes dataene mine opp til en server?

    Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.