{"id":17920950,"url":"https://github.com/davidanson/colr","last_synced_at":"2025-10-09T09:33:00.342Z","repository":{"id":66112518,"uuid":"193837528","full_name":"DavidAnson/CoLR","owner":"DavidAnson","description":"Camera of Last Resort - Possibly worse than no camera at all...","archived":false,"fork":false,"pushed_at":"2019-06-27T03:38:36.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T08:40:39.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dlaa.me/CoLR/","language":"JavaScript","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/DavidAnson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-06-26T05:47:57.000Z","updated_at":"2023-09-08T17:55:13.000Z","dependencies_parsed_at":"2023-03-10T13:00:45.291Z","dependency_job_id":null,"html_url":"https://github.com/DavidAnson/CoLR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DavidAnson/CoLR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAnson%2FCoLR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAnson%2FCoLR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAnson%2FCoLR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAnson%2FCoLR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidAnson","download_url":"https://codeload.github.com/DavidAnson/CoLR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAnson%2FCoLR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270040724,"owners_count":24516683,"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-12T02:00:09.011Z","response_time":80,"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-28T20:29:47.124Z","updated_at":"2025-10-09T09:32:55.311Z","avatar_url":"https://github.com/DavidAnson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoLR, the Camera of Last Resort\n\n\u003e Possibly worse than no camera at all...\n\n## What is it?\n\nAn absurdly simple photo app for devices with a camera and a web browser that supports [ECMAScript 2015](https://en.wikipedia.org/wiki/ECMAScript).\nIt doesn't do much, and it doesn't do it well, but at least it's free.\n\n\u003e Good, cheap, fast: you only get one and you don't get to pick.\n\n## How do I use it?\n\n1. Open \u003chttps://dlaa.me/CoLR/\u003e\n2. Allow the website access to the camera\n3. Find something interesting to capture\n4. Tap the live camera view to take a picture\n5. Tap a thumbnail to view a saved picture\n6. Tap the red 'X' to delete a saved picture\n7. Tap the live camera view to take more pictures\n\n## Where can I run it?\n\nI've used the following browser/platform configurations:\n\n- iOS/Safari\n- Android/Chrome\n- Chromebook/Chrome\n- Windows/Chrome\n\nIt _should_ work in other modern browsers/platforms as well.\n\n\u003e To experiment on a machine without a camera, the command line `chrome.exe --use-fake-device-for-media-stream --use-fake-ui-for-media-stream` is helpful.\n\u003e More info on [relevant WebRTC flags can be found here](https://webrtc.org/testing/).\n\n## Why did you make this?\n\nTo learn more about the following technologies and get experience using them:\n\n- [CSS Grid Layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout) - A modern layout system based on grid cells with the great working reference [A Complete Guide to Grid](https://css-tricks.com/snippets/css/complete-guide-grid/)\n  - *Verdict*: It's not quite a [WPF Grid Panel](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.grid?view=netframework-4.8), but it feels very similar\n- [MediaDevices.getUserMedia() API](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) - The part of the [WebRTC Media Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API) that allows websites to access the device camera for video and image capture\n  - *Verdict*: A somewhat cumbersome API that's nonetheless quite powerful\n- [Preact](https://preactjs.com/) - Exactly what it says on the box, a \"Fast 3kB alternative to React with the same modern API.\"\n  - *Verdict*: Works like a charm, easy for someone with [React.js](https://reactjs.org/) experience\n- [Dexie.js](https://dexie.org/) - More truth in advertising, a \"Minimalistic Wrapper for IndexedDB\", where [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) is \"a JavaScript-based object-oriented database\" that runs in the browser\n  - *Verdict*: Easy to use, even for someone with no prior IndexedDB experience\n\n## Where can I learn more?\n\n- The article [Taking still photos with WebRTC](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos) covers the all the basics.\n  I'd read it a long time back, forgot about it for this project, then rediscovered it for this write-up.\n- The [WebRTC samples page](https://webrtc.github.io/samples/) has lots of examples and complete code for each of them.\n- The [GitHub repository for this project](https://github.com/DavidAnson/CoLR) may also be of interest.\n\n## Why are some photos blurry?\n\nThe most likely culprit is (too long) shutter speed.\nGrabbing a frame from a video is not the same as taking a single photo (and post-processing it).\nA good explanation seems to be the second answer in the post [Can I get high resolution photo from video?](https://photo.stackexchange.com/questions/7872/can-i-get-high-resolution-photo-from-video).\nIf you want to do better, maybe start with [Generating Sharp Panoramas from Motion-blurred Videos](https://neelj.com/projects/sharppanoramas/) or [Video Snapshots: Creating High-Quality Images from Video Clips](https://www.eecs.harvard.edu/~kalyans/research/snapshots/VideoSnapshots_TVCG12.pdf)).\n*Shout out to Professor Huttenlocher!*\n\n## Why not use blobs?\n\nCaptured images are encoded to [JPEG](https://en.wikipedia.org/wiki/JPEG) using methods on the [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) interface.\nBoth [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) and [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) formats are supported - and have limitations - but data URL is used because the string-based format is easier to work with and debug against.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidanson%2Fcolr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidanson%2Fcolr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidanson%2Fcolr/lists"}