Thursday, November 17, 2016

How to obtain higher resolution photos by altering the image URL

Often websites scale down the photos which they display. If you carefully examine the image URL and change it, you may be able to increase the resolution and quality. Look for parameters which specify the size and try to change them or strip them away. Also, if the photo URL refers to another path, try to directly access that other path.

You can often get an image URL by right clicking on the image. If that does not work, use your browser's developer tools or the media tab of page info in Firefox. The inspect feature of developer tools should make finding the image fairly easy.

Here are a few examples of these transformations:

http://wpmedia.windsorstar.com/2016/11/1d1.jpg?quality=55&strip=all&w=840&h=630&crop=1
http://wpmedia.windsorstar.com/2016/11/1d1.jpg

This was pretty obvious. Remove the parameters and get the original image size. It also seems to avoid JPEG re-encoding, and the accompanying increase in artifacts.

https://i.cbc.ca/1.3929515.1484163948!/fileImage/httpImage/image.jpg_gen/derivatives/16x9_460/pillar-lights.jpg
https://i.cbc.ca/1.3929515.1484163948!/fileImage/httpImage/image.jpg

The parameters do not necessarily start with a question mark.

http://www.amherstburg.ca/ThumbGen.ashx?%2fAreas%2fCustom%2fContentFiles%2fportrait+of+ferry+and+shoreline.png/600/452/w
http://www.amherstburg.ca/Areas/Custom/ContentFiles/portrait%20of%20ferry%20and%20shoreline.png

In this case, you see another path given as a parameter to ThumbGen.ashx. You need to remove the encoding of that path. Note that the path is encoded with percent encoding and + instead of spaces.

http://i2.cdn.cnn.com/cnnnext/dam/assets/161117110259-dutch-war-ship-exlarge-169.jpg
http://i2.cdn.cnn.com/cnnnext/dam/assets/161117110259-dutch-war-ship.jpg

In this case part of the "file name" was the culprit, and the change removes cropping and text.

https://images-na.ssl-images-amazon.com/images/I/51dIUaKqkYL._SY500_.jpg
https://images-na.ssl-images-amazon.com/images/I/51dIUaKqkYL.jpg

Again, the last part of the file name before the .jpg had to be removed.

https://c1.staticflickr.com/6/5722/22981183464_8c7035afbb_b.jpg
https://c1.staticflickr.com/6/5722/22981183464_8c7035afbb_h.jpg

For some sites, there are site-specific tricks which are not self-explanatory. On Flickr, try changing the last letter after the underscore to h. In the past o was needed for some photos and may still be needed sometimes.

http://s7d5.scene7.com/is/image/CanadianTire/0431755_1?defaultImage=image_na_EN&wid=160&hei=160&op_sharpen=1
http://s7d5.scene7.com/is/image/CanadianTire/0431755_1?defaultImage=image_na_EN&wid=1600&hei=1600&op_sharpen=1

In this case, removing the parameters returns the default small size, but you can change the parameters to increase image size. Note that it would be almost entirely pointless to increase the size beyond the original size. You would just get a larger file without added detail. On some sites, if you specify a size that's larger than the original size, you will get the original size.

If you are not satisfied with what you can obtain at one site, then try Google search by image or TinEye. Remember that even if the search engine doesn't find bigger images, another site may allow you to download a larger image by modifying the URL.

No comments: