Image & Media100% Free for AllClient-Side PrivateAuto-saved (3 days)

Sample Image Generator

Create dummy images at any file size you specify, with randomised artwork and dimensions every time. Built for testing upload limits, filling layouts, and checking image pipelines.

Image format
Target size
KB

Placeholder images are needed constantly and are surprisingly annoying to source: you want one that is exactly 500KB to test an upload cap, or a 16:9 block to fill a layout, and instead you go rummaging through a downloads folder. This draws one to order — randomised artwork, randomised dimensions, and the exact byte size you asked for.

How to generate a sample image

  1. Choose an output format. JPG for realistic photo-like sizes, PNG when you need a larger file from the same content, WebP to test modern format handling.
  2. Pick a target size from the presets or type an exact figure in kilobytes.
  3. Generate. Four images appear, each with different artwork and a different aspect ratio.
  4. Download the one you want, or copy it as a data URL if it is under 200KB.

The Sample Image Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

When to use this tool

Testing an upload size limit

To check that a form really rejects files over 2MB you need one just under and one just over. Generating both takes seconds and proves whether the validation works.

Filling a layout before real photography exists

Randomised gradient blocks at the right aspect ratio show how a grid or card design behaves without licensing stock images or shipping grey rectangles.

Exercising an image pipeline

Thumbnail generation, EXIF handling, and progress indicators all behave differently on a 20KB file and a 5MB one. Having both on demand makes those paths testable.

Things worth knowing

  • The size is exact. Artwork is scaled near the target, then the file is padded with bytes after JPEG's end-of-image marker, which every decoder ignores.
  • PNG produces much larger files from the same drawing, so a PNG target is reached with a smaller image than a JPG one.
  • Each generation is fully random — press it again for four completely different images at the same size.
  • Data URLs are offered only under 200KB; beyond that they become unwieldy to paste anywhere.

Frequently Asked Questions

Are the images real image files?

Yes. Each is drawn on a canvas and encoded properly, so it opens in any image viewer or editor.

Are these real image files?

Yes. Each is drawn on an HTML canvas and encoded by the browser's own JPEG, PNG, or WebP encoder, so it opens in any viewer or editor and carries correct dimensions and headers.

How is the file size exact?

The artwork is generated at dimensions estimated to land near your target, then the encoded file is topped up to the precise byte count using padding after the format's end marker. Decoders stop reading at that marker, so the image is unaffected while the size is exact — which matters when the whole point is testing a limit.

Can I choose the dimensions?

Not directly — dimensions are derived from the size target and randomised across common aspect ratios so the four samples differ from one another. If you need specific pixel dimensions, generate one here and run it through the Image Resizer.

Is anything uploaded?

No. Images are drawn and encoded in your browser and written straight to your downloads.