/bg • BackGround Resources!


← back to /caco
This page contains two sections: Resources and Base64

Resources contains what the main header says! Backgrounds and the like. Credit isn't strictly necessary, but appreciated!
Base64 contains some information about how Rentry handles Base64 MIME data inside metadata tags and how you can create your own!


Why are the resources so simple? Isn't there something more complex?
Because the url itself is simple: /bg! I wanted to create simple backgrounds (and teach people about base64 URIs.. heh) for those who want simple rentries. You don't even have to use the resources as backgrounds; they can be decor too!

As of right now, all resources are PNG since pngs take up way less space than JPEGs when it comes to tiny icons.

RESOURCES

You can change the size with CONTAINER_OUTER_BACKGROUND_IMAGE_SIZE = <number>px
more soon!
8x8 (scaled to 64x64, or 64x48 for 8x6):

checkerboard 1 checkerboard 2 checkerboard 3 zigzag 1 striped 1 striped 2 grid 1 shaded 1

dark purple 1 dark purple 2 maroon 1 4-color 1 4-color spin desaturated rainbow rainbow 1 rainbow 2 (8x6) neon lines 1 neon lines 2

misc pattern 1

16x16 (scaled to 64x64):
swirls 1 blue noise red noise

BASE64

As you may notice in the metadata of this page, it uses an encoded Base64 URI png to render the gray tiled background on this rentry.

⎗
✓
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAi0lEQVR42u2VwQrAIAxD22L7Sf7/d3lxF2FsKuo0h0E91vgiEgnHGAm5AhGllOoNM6vnzKyqS3qZvwsz55xX9QKlE5FA6VMGO/SxwSZ9YLBPLzE1s+YBVW3Ol/Ttf/Ah7z29gF6ma3CW/jY4Tn8YIOi3AYheDHD0EtMjee/pvQ+8D7wPvA+8D37RBxc/9cF0VeowPAAAAABJRU5ErkJggg==

zoom in to see it on mobile
Which renders like this:

CONTAINER_OUTER_BACKGROUND_IMAGE (and other similar metadata tags) only accept the following image types: png, jpeg, gif, webp and x-icon. This means you cannot use svg+xml and others to render the outer background on your rentry.

The metadata tags also have a 32,768 character limit per field; so if you're planning on converting images to base64 data, make sure the image does not take up more than ∼24KB of space as base64 encoding increases data by 33%.

Why should I use a Base64 Data URI? Can't I use a URL to my own image?
You can! The main advantage for using MIME is self-containment.
It's often easier and more convenient to use an external file host for your resources, but suppose the file hosts (or your files) went down. Your rentry wouldn't render properly, or it'd be replaced with the host's own placeholder image/image not available text. Embedding base64 directly inside your rentry solves this issue! (and makes loading your rentry slightly faster as it doesn't have to ping external sites for resources)

How can I do it myself?

It's pretty simple! I use ibisPaint for asset-making, but you can use any drawing app you want for this.

  1. Create a small canvas file

My preference is anything to the power of two (8x8, 16x16, etc) but I believe other sizes can work just as well! Just make sure it doesn't go above the aforementioned 24KB limit. Once inside, paint whatever you want for your background!

  1. Save the file and convert it to Base64

Some websites you can use to handle the conversion:
https://jam.dev/utilities/image-to-base64
https://toolcove.dev/tools/image-to-base64/

You should get a URI output like this:
data:image/png;base64,[BASE64_DATA_HERE]
This is what you can paste into the metadata field to load it. Note again that Rentry only supports png, jpeg, gif, webp, and x-icon for metadata; but for simply rendering them outside of metadata as images inside a rentry's body, you can use whatever file format your browser can load.

To see some examples of what images your browser can render, visit /bgimages as the data URIs take up too much space on this rentry.

  1. Paste it into the metadata field

You can click the edit button on this rentry to see an example of how it should look like. If anything is wrong with the data/how you pasted it, rentry's own metadata checker should tell you about it.

Edit

Pub: 02 Apr 2019 05:04 UTC

Edit: 26 Nov 2026 22:56 UTC

Views: 36

Auto Theme: Dark