css image java javascript

Example images for code and mark-up Q&As [closed]


When preparing an MCVE/SSCCE that involves images, it is useful to have direct access to images.

The types of images that would cover most questions are – small images in multiple colors or shapes, animated GIFs with/without transparency, JPEGs that are ‘pairs’ of pictures & can be used in image transitions, tile sets, sprite sheets..

Are there any small (under 30KB), on-site, license & royalty free images we can hot-link to for these types of examples?


  • See also Is there a place for “E.G. images we can hot-link in code examples”?. ..Where the heck is the ‘community Wiki’ flag for this Q&A?..

    Oct 6, 2013 at 13:59

  • I haven’t voted either way but I’ll be astonished if this doesn’t get closed and deleted. It is a shopping list question.

    Oct 6, 2013 at 14:40

  • 1

    @MartinSmith it’s Sunday. Even programmers must rest! 😉

    Oct 6, 2013 at 14:51

  • @MartinSmith I appreciate what you are saying. OTOH I am hoping that (when marked community Wiki – I ‘flagged’ the question to try and get that to happen) it is seen as useful enough to dissuade people from voting for that.

    Oct 6, 2013 at 15:05

  • 1

    I’m voting to close this question as off-topic because it belongs to Meta Stack Overflow or Meta Stack Exchange.

    – Peter O.

    Jul 10, 2015 at 23:44


Here are some example images for common use, mostly from existing answers on SO.


Simple Geometric shapes generated using Java as originally seen in this answer. It includes a Java based interface that defines the URLs and makes them easy to access.

Details: 32×32 pixel PNG (4 colors x 5 shapes) with partial transparency (along the edges).




Sprite Sheets

Chess Pieces as originally seen on this answer that includes 2 other sprite sets (same image in different colors).

Details: 384×128 px (each sprite 64×64 px) PNG with partial transparency.



GIF is the only image format that supports animation. Here are a few examples.


Solid BG

Animated dashed border as seen in this answer.

Details: 100×30 px with filled BG (no transparency)

Zooming stars as seen in this answer, originally developed as a ‘screen-shot’ of a screensaver.

Details: 160×120 px with filled BG (no transparency)

Animated Water as seen in this answer to Animating Tiles In My Game.

Details: 60×60 px with filled BG (no transparency)

Transparent BG

Orbital animation, originally developed for 1.1C. The orbits of the ‘inner’ planets (from Mercury to Jupiter, with an extra orbit shown in the thick of the asteroid belt). Better on a dark BG.

Details: 450×450 & 150×150 px animated GIFs with transparency.


Sunrise & moonset over the CBD of Sydney, Australia
Sunset & Venus over a telescope on Mt Stromlo, near Canberra, Australia.

Categories: + Image Transitions

Details: 480×320 px JPEGs x 4. (Displayed here at 1/2 size.)

Panorama at Dawn across the South-Eastern Suburbs of Sydney.

Categories: (scrolling)

Details: 1474×436 px JPEG.

Dawn Panorama


This Mercator map of Earth can be tiled left/right. Originally seen on this answer. The answer also includes a second version of the image that shows a semi-transparent line for the equator (which is not in the center, but significantly below it).

Details: 640×316 px (add 44 px at bottom to center equator) PNG with transparent BG.

Categories: (scrolling)


For getting the URLs of the images, you might ‘context click’ on the image as seen in the browser and either:

  • Show the properties. The URL can be copied from the dialog that appears.
  • View image. Copy the URL from the browser address bar.


  • Use the browser ‘show source’ and copy it from the HTML.
  • For those with enough rep. (100+, to edit a community Wiki answer), go to edit the answer and pull the URL from the text.


Below is a Java class which splits up the chess piece sprite sheet, suitable for pasting in to an MCVE:

import java.awt.image.*;
import javax.imageio.*;
import java.util.*;

public final class ChessSprites {
    private ChessSprites() {}
    public static final int SIZE = 64;
    public static final BufferedImage SHEET;
    static {
        try {
            // see
            SHEET = URL(""));
        } catch (IOException x) {
            throw new UncheckedIOException(x);
    public static final BufferedImage GOLD_QUEEN    = SHEET.getSubimage(0 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_QUEEN  = SHEET.getSubimage(0 * SIZE, SIZE, SIZE, SIZE);
    public static final BufferedImage GOLD_KING     = SHEET.getSubimage(1 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_KING   = SHEET.getSubimage(1 * SIZE, SIZE, SIZE, SIZE);
    public static final BufferedImage GOLD_ROOK     = SHEET.getSubimage(2 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_ROOK   = SHEET.getSubimage(2 * SIZE, SIZE, SIZE, SIZE);
    public static final BufferedImage GOLD_KNIGHT   = SHEET.getSubimage(3 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_KNIGHT = SHEET.getSubimage(3 * SIZE, SIZE, SIZE, SIZE);
    public static final BufferedImage GOLD_BISHOP   = SHEET.getSubimage(4 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_BISHOP = SHEET.getSubimage(4 * SIZE, SIZE, SIZE, SIZE);
    public static final BufferedImage GOLD_PAWN     = SHEET.getSubimage(5 * SIZE, 0,    SIZE, SIZE);
    public static final BufferedImage SILVER_PAWN   = SHEET.getSubimage(5 * SIZE, SIZE, SIZE, SIZE);
    public static final List<BufferedImage> SPRITES =
        Collections.unmodifiableList(Arrays.asList(GOLD_QUEEN,  SILVER_QUEEN,
                                                   GOLD_KING,   SILVER_KING,
                                                   GOLD_ROOK,   SILVER_ROOK,
                                                   GOLD_KNIGHT, SILVER_KNIGHT,
                                                   GOLD_BISHOP, SILVER_BISHOP,
                                                   GOLD_PAWN,   SILVER_PAWN));


  • 6

    1+ and book marking!

    Dec 22, 2013 at 0:18

  • Excellent resource. Would it be possible to also link in the icons from the Java Look and Feel Graphics Repository ?

    Mar 4, 2014 at 15:23

  • @splungebob A good way to find out is to create an answer and embed them. I’d prefer not to do that in my answer since the license of those images is not entirely clear to me (all images in my answer were created by me).

    Mar 6, 2014 at 14:53

  • 1

    @AndrewThompson Nice solution, +1 and book marking too!

    Feb 29, 2016 at 23:39