{"id":16905978,"url":"https://github.com/hopding/jrpicam","last_synced_at":"2025-08-25T22:02:52.403Z","repository":{"id":87966618,"uuid":"48769373","full_name":"Hopding/JRPiCam","owner":"Hopding","description":"Java API to access Raspberry Pi Camera","archived":false,"fork":false,"pushed_at":"2017-04-01T13:16:52.000Z","size":888,"stargazers_count":94,"open_issues_count":6,"forks_count":27,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-02T04:34:38.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hopding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-29T22:12:34.000Z","updated_at":"2025-02-21T18:15:44.000Z","dependencies_parsed_at":"2023-05-22T04:15:27.859Z","dependency_job_id":null,"html_url":"https://github.com/Hopding/JRPiCam","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Hopding/JRPiCam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopding%2FJRPiCam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopding%2FJRPiCam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopding%2FJRPiCam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopding%2FJRPiCam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hopding","download_url":"https://codeload.github.com/Hopding/JRPiCam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopding%2FJRPiCam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272138562,"owners_count":24880128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T18:40:27.567Z","updated_at":"2025-08-25T22:02:52.380Z","avatar_url":"https://github.com/Hopding.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/Hopding/JRPiCam.svg)](https://jitpack.io/#Hopding/JRPiCam)\n# JRPiCam\nJRPiCam is a Java API that allows Java applications running on a Raspberry Pi to access the Raspberry Pi Camera. JRPiCam\nachieves this functionality by using the [`ProcessBuilder`](https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html) class to run the native `raspistill` program on the RPi. This means that \nJRPiCam has all the same functionality as `raspistill`, plus additional Java specific features.\n\n\u003cimg src=\"http://hopding.com/img/pi-cam.jpg\" width=\"500\" alt=\"Raspberry Pi Camera Photo\"\u003e\n\nBecause JRPiCam works by invoking the `raspistill` software, it is important that your RPi be properly configured to run \n`raspistill`. The appropriate settings may be configured by running `raspi-config` in the terminal of your RPi. Further \ninstructions can be found [here](https://www.raspberrypi.org/documentation/configuration/camera.md).\n\n# Using JRPiCam\nTo use JRPiCam in your project, just download and unzip the most recent [release](https://github.com/Hopding/JRPiCam/releases/tag/v1.1.1), then add the `jrpicam-1.1.1.jar` file to your project's build path.\n\nThe core component of JRPiCam is the `RPiCamera` class, which can be instantiated as follows:\n```java\n// Create a Camera that saves images to the Pi's Pictures directory.\nRPiCamera piCamera = new RPiCamera(\"/home/pi/Pictures\");\n```\nVarious options can be set on the camera by calling the appropriate methods:\n```java\npiCamera.setWidth(500).setHeight(500) // Set Camera to produce 500x500 images.\n    .setBrightness(75)                // Adjust Camera's brightness setting.\n    .setExposure(Exposure.AUTO)       // Set Camera's exposure.\n    .setTimeout(2)                    // Set Camera's timeout.\n    .setAddRawBayer(true);            // Add Raw Bayer data to image files created by Camera.\n// Sets all Camera options to their default settings, overriding any changes previously made.\npiCamera.setToDefaults();\n```\nOnce the `RPiCamera` has been created, and the desired options have been adjusted, an image may be captured from the RPi Camera\nby called the takeStill() method:\n```java\npiCamera.takeStill(\"An Awesome Pic.jpg\");\n```\n`takeStill()` requires a String to be passed in to save the image under. In this case, once the Camera has captured the image, it will be saved as \"/home/pi/Pictures/AnAwesomePic.jpg\" (since we've set the Camera to save images to the \"/home/pi/Pictures\" \ndirectory).\n\n`takeStill()` also returns a File object that can be used to easily obtain and load the image after it has been saved to the Pi's memory. The following code captures an image, saves it, and then loads it into a `BufferedImage`\n```java\nBufferedImage image = ImageIO.read(piCamera.take(\"An Awesome Pic.jpg\")));\n```\nImages may also be loaded directly into a buffer within your application by calling the `takeBufferedStill()` method:\n```java\nBufferedImage image = piCamera.takeBufferedStill();\n```\nCapturing images this way is much faster than saving them to memory and then loading them into your application (as you would\nhave to do with the `takeStill()` method), and is particularly useful if you don't want to save the photo in the RPi at all (perhaps you want to send it over a network and save it on a remote server).\n\n# Wiki\nAdditional code examples and information can be found in the `src/main/java/com/hopding/jrpicam/examples` directory and on the [JRPiCam wiki](https://github.com/Hopding/JRPiCam/wiki).\n\n# Javadoc\nThe Javadoc for the project is hosted online [here](http://hopding.com/docs/jrpicam/). It can also be built manually with a Gradle task; see [below](https://github.com/Hopding/JRPiCam#building-the-project).\n\n# Examples\nThe releases contain a number of example JARs (pre-built JARs of the classes in the `src/main/java/com/hopding/jrpicam/examples` directory) that can be executed on the RPi's terminal:\n\n* `demo-view-1.1.1.jar`\n* `shoot-buffered-still-1.1.1.jar`\n* `shoot-still-1.1.1.jar`\n* `shoot-timelapse-1.1.1.jar`\n\n`demo-view-1.1.1.jar` runs a demo gui program that illustrates some functions of JRPiCam. The rest of the examples show how to do things like take a still image, save it, load it into a buffer, and take a series of images.\n\nTo run them, just download and unzip the most recent [release](https://github.com/Hopding/JRPiCam/releases/tag/v1.1.1), open it in a terminal, and run the following:\n```\n$ java -jar examples/[jar name]\n```\nfor example:\n```\n$ java -jar examples/demo-view-1.1.1.jar\n```\n\n# Building the Project\nJRPiCam is structured as a Gradle project. It contains tasks to build the library JAR, the example JARs, and the Javadoc. To build the project, you must first clone or download the project repository, and open a terminal therein. Then, assuming you're using Windows' Powershell or Unix's Bash:\n\n* To build the main library JAR (`jrpicam-1.1.1.jar`):\n```\n$ ./gradlew jar\n```\n* To build the example JARs:\n```\n$ ./gradlew buildExamples\n```\n* To build the Javadoc\n```\n$ ./gradlew javadoc\n```\nThe JAR files will be located in the `build/libs` directory. The Javadoc will be located at `build/docs/javadoc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopding%2Fjrpicam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhopding%2Fjrpicam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopding%2Fjrpicam/lists"}