Skip to content

Instantly share code, notes, and snippets.

@wordpressvn
Forked from Sauerstoffdioxid/googleurlparams.md
Created November 26, 2023 11:45
Show Gist options
  • Save wordpressvn/1885d6541b58e79cd04117197b39fcf1 to your computer and use it in GitHub Desktop.
Save wordpressvn/1885d6541b58e79cd04117197b39fcf1 to your computer and use it in GitHub Desktop.
Google/Blogger Image URL Parameters

Google/Blogger Image URL Parameters

This is a simple and short-lived effort to document what is known about Google's (Blogger's/Blogspot's) image URL parameters.

Where to use them?

  • On Blogger's image URL's: 2.bp.blogspot.com/-OF7u67HQE1M/VHc8S8qJTDI/AAAAAAAACxI/UD-11c63diQ/s1600/005.png
  • On just about any googleusercontent image URL: https://lh3.googleusercontent.com/Jvmz11cLrvNIHG_LWjVO9B-UV2IN4Cfk1pycbhWZl6IriMgCAGCOFuBRtoHaiZ6xeVGqCugZcCql=w176-h176-n-o

Replace the bolded parts with the parameters.

The Parameters

# represents numbers; * is used a wildcard, meaning anything can follow.

Parameters can be combined by joining the with a hyphen, eg. w200-h100-c.

Known Parameters

Resizing

param description
w# specifies the width.
h# specify the height.
s# fit the image into a square of specified size. equivalent to setting w and h to the same value.
nu No Upscaling of files smaller than requested.
s Force the scaling, ignoring the aspect ratio. Requires both w and h to be explicitly set. ignores nu.

Aspect ratio will be preserved by default. Also, nu seems to be set by default for resize-only requests.

Cropping

param description
c crop the image
cc circular mask applied over the crop. see also bc# background color option below.
ci the same as c?
p crop with a different focus
pf same as p?
pp same as p?
n similar to the p crop. requires both w and h to be set.
fcrop64=1,00000000ffffffff free crop. (I have no idea how to use that though.)

I'm not too sure how c and p are different from another. The crop parameters change the "fit into this size" approach from the resizing parameters into "fill this space". Cropping will force a resize even if the image is smaller, unless nu is used.

Editing

param description
fh flip horizontally
fv flip vertically
r# rotate by # degrees (must be one of the following: 90, 180, 270)
br# border radius of #px. (can be used without specifying a border.) see also bc# background color option below.
b# adds a border of #px width in c# color. Does not play well together with other editing parameters.
c# set the color for editing operations that use them (eg. b#). If not set, falls back to white. Accepts hex input: c0x######
bc# set the background color for formats that don't support transparency. If not set, falls back to c#, or black. Accepts hex input: bc0x######
pd pads the image to the given size using c# background color

Output Formats

param description
rj forces JPEG output. Does not support transparency. Also see bc# background color above.
rp forces PNG output.
rw forces WebP output. Does support transparency.
rg forces GIF output.
rh forces MP4 output. (Intented for GIF conversion.) Does not support transparency. Also see bc# background color above.
nw No WebP. Disables WebP output even if requested with rw. Might fallback to PNG, so use with caution.
h HTML output. A simple html file with a single image element the image as specified (adds ft parameter).
g outputs some weird xml file
fg same as g
pg downloads a file called tile.binarypb. idk what it is.
l# set the quality level for lossy compression formats (jpg, webp). Seems to be ignored by the webp output sometimes. Takes precedence over v#, even in cases where it doesn't work. [it's a lowercase L]
v# also sets the compressions level. # is much more limited, but it seems to always be applied. v0 is the original image quality. v1 equals l60. v2 equals l40. v3 and above equal l20. Only works if an output format is explicitly set.

Tiled Images

With the g (or fg) option you can get an xml file containing tiling information. To use the tiling, special parameters x, y and z can be used. x and y specify which tile should be returned. z specifies how far zoomed out the images are. For x and y refer to num_tiles_x and num_tiles_y respectively from the xml. z maps to the index of each pyramid_level, 0 being the most zoomed out.

Unknown Parameters

These are parameters that exist, but where I have no idea what they do or how to correctly use them.

param notes
ft automatically added by eg. the html output
n
o
k
a
b
r
t*
q*
nc
nd
ng
no
ns
a#
e#
al
gd
il
lf
lo
md
mm might look like nothing, but the response headers suggest it is indeed an option if called with correct parameters
mo
mv like mm
pa
sg
sm
fm gives an image of the default avatar
ip does change the filesize, but idk what it actually does
cp#
pc#
sc#
vb#

Special Thanks

Let me know when you find more options, and I will add them here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment