Skip to main content

Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!

Project description

Python Script for ‘searching’ and ‘downloading’ hundreds of Google images to the local hard disk!

Summary

This is a command line python program to search keywords/key-phrases on Google Images and then also optionally download one or more images to your computer. This is a small program which is ready-to-run, but still under development. Many more features will be added to it going forward.

Compatability

This program is compatible with both the versions of python (2.x and 3.x). It is a download-and-run program with no changes to the file. You will just have to specify parameters through the command line. ___

Installation

Using pip:

$ pip install google_images_download

Manually:

$ git clone https://github.com/hardikvasa/google-images-download.git
$ cd google-images-download && sudo python setup.py install

Usage

$ googleimagesdownload [Arguments...]

Arguments

Note: If single_image or url parameter is not present, then keywords is a mandatory parameter. No other parameters are mandatory.

Examples

  • If you have python 2.x version installed

python google-images-download.py --keywords "Polar bears, baloons, Beaches" --limit 20

  • If you have python 3.x version installed

python3 google-images-download.py --keywords "Polar bears, baloons, Beaches" --limit 20

  • Using Suffix Keywords allows you to specify words after the main keywords. For example if the keyword = car and suffix keyword = 'red,blue' then it will first search for car red and then car blue

python3 google-images-download.py --k "car" -sk 'red,blue,white' -l 10

  • To use the short hand command

python google-images-download.py -k "Polar bears, baloons, Beaches" -l 20

  • To download images with specific image extension/format

python google-images-download.py --keywords "logo" --format svg

  • To use color filters for the images

python google-images-download.py -k "playground" -l 20 -c red

  • To use non-English keywords for image search

python google-images-download.py -k "北极熊" -l 5

  • To download images from the google images link

python google-images-download.py -k "sample" -u <google images page URL>

  • To save images in specific main directory (instead of in ‘downloads’)

python google-images-download.py -k "boat" -o "boat_new"

  • To download one single image with the image URL

python google-images-download.py --keywords "baloons" --single_image <URL of the images>

  • To download images with size and type constrains

python google-images-download.py --keywords "baloons" --size medium --type animated

  • To download images with specific usage rights

python google-images-download.py --keywords "universe" --usage_rights labled-for-reuse

  • To download images with specific color type

python google-images-download.py --keywords "flowers" --color_type black-and-white

  • To download images with specific aspect ratio

python google-images-download.py --keywords "universe" --aspect_ratio panoramic

  • To download images which are similar to the image in the image URL that you provided (Reverse Image search).

python3 pr.py -si <image url> -l 10

  • To download images from specific website or domain name for a given keyword

python google-images-download.py --keywords "universe" --specific_site example.com

===> The images would be downloaded in their own sub-directories inside the main directory (either the one you provided or in ‘downloads’) in the same folder as the python file that you run.


SSL Errors

If you do see SSL errors on Mac for Python 3 please go to Finder —> Applications —> Python 3 —> Click on the ‘Install Certificates.command’ and run the file.

Contribute

Anyone is welcomed to contribute to this script. If you would like to make a change, open a pull request. For issues and discussion visit the Issue Tracker

Disclaimer

This program lets you download tons of images from Google. Please do not download any image without violating its copyright terms. Google Images is a search engine that merely indexes images and allows you to find them. It does NOT produce its own images and, as such, it doesn’t own copyright on any of them. The original creators of the images own the copyrights.

Images published in the United States are automatically copyrighted by their owners, even if they do not explicitly carry a copyright warning. You may not reproduce copyright images without their owner’s permission, except in “fair use” cases, or you could risk running into lawyer’s warnings, cease-and-desist letters, and copyright suits. Please be very careful before its usage!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_images_download-1.0.1.tar.gz (10.8 kB view details)

Uploaded Source

File details

Details for the file google_images_download-1.0.1.tar.gz.

File metadata

File hashes

Hashes for google_images_download-1.0.1.tar.gz
Algorithm Hash digest
SHA256 16cdd7831f67aef5d148f628b0b673e339569802bd0e8c7b489607cfcd2818d1
MD5 1dbdda102219d3bec6bd4924c0d0f561
BLAKE2b-256 d13ef118b091d77836cfe53211a3667eaed4b2a1aedf60bc349a19d3e4ca8bcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page