Facebook Twitter Instagram Pinterest YouTube
    Trending
    • Add Kodi to RetroPie Menu
    • Disable Auto-login in Raspberry Pi OS
    • Raspberry Pi Cloud Storage with MEGA
    • RetroPie Temperature Monitor from Menu
    • Pi Pico Pinout and Power Pins
    • Install Arduino IDE on Raspberry Pi
    • Raspberry Pi 400 SSD Upgrade
    • Raspberry Pi Temperature Monitoring
    Facebook Twitter Instagram Pinterest YouTube RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        May 6, 2022

        Add Kodi to RetroPie Menu

        February 26, 2022

        Disable Auto-login in Raspberry Pi OS

        February 2, 2022

        Raspberry Pi Cloud Storage with MEGA

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Hardware»Camera Module»Taking Hi-Res Photos With The Pi Camera Module
      Gromit Unleashed Pi Camera Testing

      Taking Hi-Res Photos With The Pi Camera Module

      20
      By Matt on May 22, 2013 Camera Module

      pi_camera_module_17Taking photos with the Pi Camera Module is easy once you have plugged it in and made the correct configuration changes. In order to do this make sure you have read my Installing The Raspberry Pi Camera Module page.

      Once you’ve completed the camera installation you won’t need to do it again and you can concentrate on taking photos and recording HD video.

      Basic Photo Capture

      Capturing stills is done using the raspistill command line utiltity and is as easy as typing :

      raspistill -o myimage.jpg

      pi_camera_module_04This takes a photo which is then saved as “myimage.jpg”. By default the image is previewed on the screen and is captured after a 5 second delay. You can change the delay by using the “-t” option and supplying a time in milliseconds.

      In the example below we take a photo with a delay of 3 seconds (3000 milliseconds) :

      raspistill -o myimage.jpg -t 3000

      This is a list of some of the more common options available when using raspistill :

      -?,   --help       : This help information
      -w,   --width      : Set image width <size>
      -h,   --height     : Set image height <size>
      -q,   --quality    : Set jpeg quality <0 to 100>
      -o,   --output     : Output filename <filename>
      -v,   --verbose    : Output verbose information during run
      -t,   --timeout    : Time (in ms) before taking picture
                          (if not specified, set to 5s)
      -th,  --thumb      : Set thumbnail parameters (x:y:quality)
      -d,   --demo       : Run a demo mode
      -e,   --encoding   : Output format (jpg, bmp, gif, png)
      -tl,  --timelapse  : Timelapse mode. Takes a picture every <t>ms
      
      -p,   --preview    : Preview window settings <'x,y,w,h'>
      -f,   --fullscreen : Fullscreen preview mode
      -n,   --nopreview  : Do not display a preview window
      
      -sh,  --sharpness  : Set image sharpness (-100 to 100)
      -co,  --contrast   : Set image contrast (-100 to 100)
      -br,  --brightness : Set image brightness (0 to 100)
      -sa,  --saturation : Set image saturation (-100 to 100)
      -ISO, --ISO        : Set capture ISO
      
      -vs,  --vstab      : Turn on video stablisation
      -rot, --rotation   : Set image rotation (90,180,270)
      -hf,  --hflip      : Set horizontal flip
      -vf,  --vflip      : Set vertical flip

      To get a full list of options that can be used type :

      raspistill | less

      Scroll using the arrow keys and press q to return to the command line.

      Depending on how you position your camera you may need to use the “-rot” option to ensure your photos are the right way around.

      Time Lapse Photo Capture

      Another great feature of the utility is the easy capture of a series of images over a specified period of time. You could write your own software to do this but for speed you can’t beat the time lapse options provided :

      raspistill -o myimage_%d.jpg -tl 2000 -t 25000

      The -tl option sets the time between photos (in milliseconds) and the -t option sets the total time the sequence will last. So in this example a photo will be taken every two seconds (2000ms) for a total time of twenty five seconds (25000ms).

      In this example we take a photo every minute (60000 milliseconds) for a total time of 2 hours (2 x 60 x 60 x 1000 milliseconds) :

      raspistill -o myimage_%d.jpg -tl 60000 -t 7200000

      The “%d” results in a sequence of numbered images being produced. In this case you would get images named :

      myimage_1.jpg
      myimage_2.jpg
      myimage_3.jpg
      myimage_4.jpg
      ...

      If you change the “%d” to “%04d” you can pad the numbers with zeroes to always give four digits. I much prefer this as it gives you a sequence that looks like :

      myimage_0001.jpg
      myimage_0002.jpg
      myimage_0003.jpg
      myimage_0004.jpg
      ...

      Much neater!

      As I experiment with the camera I will add other posts and cover some more advanced techniques but until then have fun!

      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleInstalling The Raspberry Pi Camera Module
      Next Article Capturing HD Video With The Pi Camera Module

      Related Posts

      Send Pushover Notification when MotionEyeOS Boots

      Monitoring Raspberry Pi GPIO with MotionEyeOS

      Detection Area Masking in motionEyeOS on the Raspberry Pi

      20 Comments

      1. kruthi on June 23, 2013 5:14 pm

        can we do the same with webcam?

        Reply
        • Matt on June 23, 2013 11:15 pm

          The raspistill application only works with the official Raspberry Pi camera module. It is possible to capture images from a webcam but not all webcams work properly with the Pi. Unlikely to find a webcam that get close to the 5 megapixels of the camera module.

          Reply
      2. Isaac on July 4, 2013 9:51 pm

        Can it take pictures in python without using python to run a command line (as in a module for python)? Or is it only possible using python to run a command line?

        Reply
        • Matt on July 6, 2013 8:45 am

          At the moment I’m not aware of a proper Python library. The sourcecode for the raspistill utility is available so it should be possible to create a library for it. This would be better for video recording as there isn’t a nice way to stop video recording at the moment without using “kill”. Creating a Python module is out of my league so I’m hoping someone with the skills can create one.

          Reply
      3. Chris on July 18, 2013 2:40 pm

        Do you know how to set a custom exposure time on an image e.g. for 30 seconds? The only suitable mode is ‘verylong’ exposure but it does not seem to have much effect. Thanks

        Reply
        • Matt on July 18, 2013 7:23 pm

          Unfortunately not although I think it has been discussed on the Raspberry Pi forums. Hopefully the camera software will be developed in the future to allow these sort of features.

          Reply
      4. Todd on October 6, 2013 4:10 am

        So I have my camera up and working, but where is it saving the pictures to?

        Reply
        • Matt on October 6, 2013 7:41 pm

          Should be the same directory that you called raspistill from.

          Reply
      5. Dirk on November 1, 2013 10:22 am

        Hi Matt. We are using the camera in timelapse mode (1 sec interval) , have set the brightness, contrast and ISO and are capturing laser speckle patterns. Even though therse is no change in the speckle intensity on the subject over time, we find that over 20 images ther is a noticeable random overall change in the captured image intensity from image to image. We have tried various Metering Modes, but to no avail, the intensity changes from image to image. Soemtimes we also get an image that is monochrome or red, even though we are using a green laser. Any ideas?

        Reply
        • Matt on November 1, 2013 11:20 am

          Have you turned off or covered up the camera’s red led? That can be enough to interfere with images.

          Reply
          • viv on January 17, 2018 9:41 pm

            Can you please elaborate on how the LED effects image quality? I was always under the impression that the light is placed onboard the piCam to signal the camera being active

            Reply
            • Matt on January 19, 2018 1:38 pm

              The LED can cause reflections on nearby surfaces (glass, perspex, shiny plastic etc) and this can result in a “glow” in the photos. Also if you are making a wildlife or security camera you might not want animals or burglars to see any light coming from your project.

              Reply
      6. Chris Gavin on November 16, 2013 4:20 pm

        Hi, many thanks for sharing this info.
        I’m working on a DIY frame by frame cine film scanner, (currently running with Arduino ) and now considering using the RPi and camera for the frame by frame image capture…
        I would be capturing 5MB stills, hopefully from a Python programme.
        I wonder what the most rapid capturing of stills the Pi can handle?
        The best way to test this might be to use the timelapse option and decrease the time between captures until the PI can’t handle the data any more.
        This result would determine whether the Pi and camera is viable for my project, but I haven’t bought one yet…
        If you have tried something like this (rapid stills capture) I’d love to hear your findings.. many thanks. Chris.

        Reply
        • Matt on November 16, 2013 7:11 pm

          Ideally the Pi needs some time to do its exposure calibration so I suspect the stills rate would be something like 1 fps. However the Pi can capture Full HD video so you could simply capture the whole film as a video file?

          Reply
      7. Kirk Fraser on March 31, 2014 2:37 am

        I recently learned a 5 megapixel IP camera has an 8 second delay from seeing motion to showing it on the computer screen. Does the Raspberry Pi have zero delay so it can be useful for robot control? Thanks.

        Reply
        • Matt on April 2, 2014 4:38 pm

          There is no reason the Pi can’t display video instantly. It depends how you are transmitting the data but I’ve seen people stream video from the Pi to a networked computer with no delay.

          Reply
      8. Kari on April 18, 2014 4:53 pm

        Hello

        How can i set timeout -t option to infinity? I want to use camera as a microscope and overhead projector and it should stay on all the time.

        How can i stream live image to network?

        Reply
      9. Ari on May 9, 2014 9:06 pm

        Hey Kari,

        You probably have already figured out, how to stream pictures or videos, as I would suggest, from your pi. Anyway, I got streaming working using these instructions: http://www.akeric.com/blog/?p=2437

        Reply
      10. Olivia on January 22, 2017 2:14 am

        Where are the pictures saved? I can’t figure out what you meant by saying that they are in “the same directory that you called raspistill from.”. I can’t find that.

        Please help.

        Reply
        • Matt on January 22, 2017 12:27 pm

          At the point you run “raspistill” you are in a directory. This is most likely /home/pi. If you run the command “pwd” it will list the current directory. If you use the command “ls” it will list the files in the current directly. This will probably list the images captured.

          Reply

      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      May 6, 2022

      Add Kodi to RetroPie Menu

      February 26, 2022

      Disable Auto-login in Raspberry Pi OS

      February 2, 2022

      Raspberry Pi Cloud Storage with MEGA

      January 7, 2022

      RetroPie Temperature Monitor from Menu

      January 24, 2021

      Pi Pico Pinout and Power Pins

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      3D Printing Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter LCD LED Linux media Minecraft Model A Model B motionEyeOS PCB photography photos Pi-Lite portable power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives
      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Recent Posts
      May 6, 2022

      Add Kodi to RetroPie Menu

      February 26, 2022

      Disable Auto-login in Raspberry Pi OS

      February 2, 2022

      Raspberry Pi Cloud Storage with MEGA

      Facebook Twitter Instagram Pinterest YouTube RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2022 - All Rights Reserved - Matt Hawkins

      Type above and press Enter to search. Press Esc to cancel.