AAUGH.com Peanuts shopping site, AAUGH.com Peanuts book collecting guide

Abusing Amazon images

by Nat Gertler,

Created May 21, 2005. Last updated July 2, 2005.

Amazon.com feeds out a lot of product images, putting out the same book cover (say) in a variety of sizes and formats. By experimentation, I found that they don't actually have all the sizes and formats stored. Instead, they have a system that generates each requested image. The details of size and format are built into the image's URL. What that means that, if you want, you can create URLs that generate odd and unlikely Amazon images (you can see my gallery of images here). The proper combination of product choice and added elements and effects could create an interesting visual. What you see here is my best understanding of things based on trial and error and messing with various example URLs I've found.

Let's take a look at an example

http://images.amazon.com/images/P/0762423374.01._PE20_SCMZZZZZZZ_.jpg

          The first part - http://images.amazon.com/images/P/ - doesn't vary. That points to the right place on the Amazon servers. The rest is a series of variable fields, each field separated from the next by a period (or, for those who live solely in web URLs, a "dot".)

  • 0762423374 is the ASIN, the identifier that Amazon uses for every item it stocks. For books, this is the ISBN, stripped of its dashes. You can find the ASIN in the product details section of any Amazon product listing.
  • 01 is an odd duck of a field. For American items, it selects the image and the format of the percentage off bullet.
    • 01: The basic. This is also what you get if you put just a single digit in, without the leading zero. (This can sometimes be followed by a dash and then a fairly long alphanumeric string, then a .PT01. - this is for products that have alternate views. Changing that .PT01. to .PT02. gives the next view, and so forth.)
    • 02: Slightly different bullet design.
    • 03: This is the cool one to me - this is the original solicited cover, which as you can see in this case was quite different from the later update. I've found another example where the 01 and 03 images are the same, but the 02 one appears to be a different scan. I'm not sure if the number placement of this is constant, and many items won't have a different image for this value. Doesn't carry the percentage bullet. (This seems to be the prefered value at Amazon.de.)
    • Higher numbers all look like this for this book. I'm not sure if there is standardized, or whether there is some variation of what is in each slot from book to book, but higher two-digit numbers don't generate a percentage bullet. However, Japanese items use 09, and don't generate an image for lower values.
  • _PE20_SCMZZZZZZZ_ gives information on the size of the image and adornments added to the image. I've found three formats that this field can have.
    1. THUMBZZZ - just the size code. This works only for certain size codes
    2. 20SCZZZZ - the percent discount followed by the size code. This only works with certain size codes. Using 00 will generate an image without a bullet, while 1C presents a special one cent bullet. (The one cent bullet is only available if the image-and-bullet-type field is set to 01.)
    3. _PE20_SCMZZZZZZZ_ - a string of options separated by underscores, including lead and end underscores. A list of known size codes and options is below.
  • jpg - This can be jpg, jpeg, png, or gif. Oddly, it doesn't matter. The file will be a JPEG format graphics file no matter what extension you use. You can even get away with using no extension, with or without the leading period. However, you can't just put random characters for the extension.

size codes

The size codes that I've found all seem a mite odd to me. They all end in a number of Zs, and I imagine there is some significance to the number that I've not found, but you can't just mess with them

  • THUMBZZZ - small size. Only works in options format 1.
  • TZZZZZZZ - default image size. Only works in options format 1.
  • SCZZZZ (or any otherwise-meaningless six character alphanumeric string) - default image size. Percent bullet goes in the lower right. Only works in options format 2.
  • SLZZZZ or TLZZZZ - default image size. Percent bullet goes in the lower left. Only works in options format 2.
  • SCTZZZZZZZ - small size. Only works in options format 3.
  • SCMZZZZZZZ - medium size. Only works in options format 3.
  • SCLZZZZZZZ - large size. Only works in options format 3

options

The options (for use only in format 3) I've found so far are

  • PE55 - Puts a percent discount bullet on the lower right of the image. Value can be 01-99; 00 means no bullet, 1C is a one cent bullet. (The one cent bullet is only available if the image-and-bullet-type field is set to 01.)
  • PD55 - Same as PE except the bullet is on the lower left.
  • PB - Put a drop shadow on the image, down and to the left.
  • PC - Put a drop shadow on the image, down and to the right. These are only designed to look like a real shadow for rectangular items such as books. If you want it to look like a real shadow, make sure to put this option before any PE, PI,or rotate option. Ooh, here's a neat little feature:if you add an argument to it (such as PC,4) the total image size is reduced.
  • PA10,6,-8,20 - This is a more complete drop-shadow tool. The first number is the number of pixels added to the image in each dimension, generally just adding blank area. The second is how far the shadow's edge is from the item's edge horizontally in pixels (positive values go to the right, negative to the left). The third is how far the shadow's edge is from the image's edge vertically (positive values go down, negative values go up.) The final number sets how sharp and dark the shadow is - 0 would be perfectly square, while higher numbers make the shadow ever fuzzier and lighter.
  • PF - Puts a half-disc image sticking out of the side of the product.Adding a value after this decreases the size of the existing image and adds space between the existing image and the disk image.
  • PU45 - Tilts the image to the left. Number is number of degrees. Default (no number) looks to be 5. Range is 0-99. (Greater rotations can be done simply by using multiple turn commands.)
  • PV45 - Tilts the image to the right.. Number is number of degrees. Default (no number) looks to be 5.Range is 0-99.
  • PT85 - Tilts the image to the right. Number is number of degrees. Default (no number) is 0.
  • PIsm.arrow,TopLeft,-2,-19 - Adds another sort of bullet to the image.
    • sm.arrow - the type of bullet. So far, the bullets that I've found are:
      • sm.arrow
      • m.arrow
      • dp-schmooS
      • dp-schmoo2 (and if you're wondering,"schmoo" is likely a misspelling of "shmoo", a white bulbous creature from the Li'l Abner comic strip that the little figure here somewhat resembles.)
    • TopLeft - where the placement of the bullet is measured from. TopLeft, TopRight, BottomLeft and BottomRight all work. TopLeft is the default,if you enter meaningless data here.
    • -2,-19 - the placement of the bullet. The first number is horizontal - positive values place to the right, negative values to the left. The second number is vertical - positive down, negative up.
  • AA25 - This resizes the image to a fixed pixel dimension (setting its larger dimension, with the smaller one set in proper proportion). It seems like you can set any number up to the actual size that the image is stored at Amazon; above that, this adds white space to around the borders of your image. Expanding to the point where you're adding white space also appears to shrink the bullet. (I need to do a little more exploring here to get the details worked out.) Values from 1 to at least 5000, by which point your so far beyond the size of any actual image at Amazon that there's no point in thinking about it.
  • BO10,155,0,145 - Adds a border around the picture. The first number is the border thickness in pixels, and can be up to at least four digits long, which is more than you'll ever need. The remaining three values are the border color in decimal-represented RGB. For those of you who aren't so versed in geekspeak, what this means is you're mixing a color together using red, green, and blue. There's a number for the amount of red (running from 0 to 255), followed by one for the amount of green, followed by one for the amount of blue.
  • ZAText%20stuff,5,15,100,100,times,20,255,40,240 - Adds text. That's a long option, but it has a lot of stuff. When writing out the text content, you may run into problems if you use characters that are not letters or numbers (such as spaces, commas, and so forth), because they may be misinterpreted in a URL. Instead, you have to use encoded ASCII values. Use %20 for a space, %2C for a comma, %2E for a period, and go here to look up other characters. The next two fields (5,15) are the position of the upper left corner of the text area, measured from the upper left corner of the image. In this case, it's 5 pixels down, 15 to the right. The next two figures show where the bottom right of the text area is, 100 pixels to the right and 100 down from upper left of the text box. This is important because word wrap will be done based on where the right edge of the text box is. After that is the font, and so far I've identified two: times and verdenab (which is presumably some sort of misspelling of verdana, a common font). Next (20) is the font size, and then a three-digit RGB code for the text color. (You can see RGB codes explained in the BO option discussion.)
  • ZC - The same as ZA, except that it places the text box so that the longest line of text in the box is centered on the image. This is good centering if you have only one line of text. It doesn't center each individual line so the left edge of shorter lines will still lign up with the left edge of the longest line.
  • BL10 - This blurs the image. The number appears to be the blur raidius, so the larger a number you enter, the blurrier your image will get..

The cool thing (if you want to generate unlikely Amazon images) is that you're not limited to one use of any of these options. You can have multiple discounts, multiple shadows, multiple bullets, generating images that Amazon would never have on its site. However, every additional option you add generates another 10% to the image dimensions, adding white space around the image. And that 10% compounds; add a lot of bullets, and you'll find that you have a small image in a large blank space. Note also that the options are interpreted in order, which can have an impact on what overlaps what.

foreign Amazons

The foreign Amazon sites all seem to use the same method; the only difference is that instead of starting with the http://images.amazon.com/ domain, the amazon.jp images start with http://images-jp.amazon.com/ while the amazon.co.uk and amazon.de images start with http://images-eu.amazon.com/ - Amazon.ca uses the same domain as Amazon.com.

oddities

I cannot yet explain why this particular book, image type 1, option style 2, gives a smaller image when the percentage is set to 34 on a size of TRZZZZ or TLZZZZ than it gives for other percentages. (Added later: well, whatever was causing that has now been changed, as these are now all the same size. I have a theory: on the day that I found this, Amazon had entered a new larger scan of the image. However, they probably keep commonly-requested image/option combinations buffered, so the images I was getting for the then-current discount of 34% were still of the old scan.)

on beyond...

Are there other secrets, other options, other things to be discovered about the Amazon product image system? Almost certainly.

Note: all of the product images on this page are coming directly from Amazon. If you don't quite get the URL information being discussed, right-click (Windows) or ctrl-click (Mac) on the image, and chose your browsers command to view the image, or to copy the image address which you can then paste into the address field of your browser. Your address field will have the full URL for you to study!

Check out my gallery of cool abused Amazon images!

Ethical Considerations

Abusing Amazon images for decorative art on your own web pages makes use of Amazon's processor and bandwidth. While Amazon is generally good about letting people use their systems for interesting projects, it should be remembered that they make access available in order to ultimately sell more stuff.

My recommendation for those who want to use Amazon's services without being a total leech is to either save a copy of the resultant image and host it directly, or be sure to include a link to the Amazon sales page for the product depicted. For example, all the images on this page are for Peanuts Guide to Life, a collection of quotes and images from the popular comic strip.

If you're using various overlay images, particularly percentage bullets, include something like:

Warning: the discount percentages and other feature blurbs depicted on this page are being used in a purely decorative fashion. They don't represent any discount or feature actually being offered.

Content copyright 2005 Nat Gertler