Free plan

Sprite Sheet

Combine many small pictures into one sheet
POST
/v1/images/sprite-sheet

About this tool

This tool puts many small pictures, such as icons or animation frames, into one big picture called a sprite sheet. Each picture gets an equal cell, and you choose how many columns there are, the cell size and the background colour. You also get a list that says where each picture sits on the sheet. It takes up to 100 pictures.
For example, you combine 20 small icons into one file so a website or game loads them in one go.

How to use it

  1. Choose this tool.
  2. Add your pictures with Upload or drag and drop (up to 100).
  3. Choose the number of columns and, if you like, the cell width and height.
  4. Choose a background colour.
  5. Press Generate, then download the sheet and the list of positions.

What you get back

You get one big picture with all your pictures laid out in a grid, plus a list of where each one is. Download both.
GOOD TO KNOW
Zero spacing; the response includes the per-image coordinate manifest.
TEST IT LIVE

Try Sprite Sheet in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/sprite-sheet
Tool ID
images.sprite-sheet
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/sprite-sheet" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'cols=1' \
  -F 'cellWidth=1' \
  -F 'cellHeight=1'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.spriteSheet({
    "images": 'photo.jpg',
    "cols": 1,
    "cellWidth": 1,
    "cellHeight": 1
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->spriteSheet([
    'images' => 'photo.jpg',
    'cols' => 1,
    'cellWidth' => 1,
    'cellHeight' => 1,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Combine many small pictures into one sheet.

Sprite Sheet accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Sprite Sheet is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/sprite-sheet with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.