{"id":13526401,"url":"https://github.com/scijs/get-pixels","last_synced_at":"2025-04-14T03:56:08.543Z","repository":{"id":8466760,"uuid":"10065278","full_name":"scijs/get-pixels","owner":"scijs","description":"Reads an image into an ndarray","archived":false,"fork":false,"pushed_at":"2024-07-19T18:37:51.000Z","size":543,"stargazers_count":545,"open_issues_count":25,"forks_count":113,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-07T01:01:30.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/scijs.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":"2013-05-14T21:26:35.000Z","updated_at":"2025-04-06T22:11:22.000Z","dependencies_parsed_at":"2024-06-18T11:22:33.280Z","dependency_job_id":"6bed9028-63f3-4c7d-8f26-7c51f0940843","html_url":"https://github.com/scijs/get-pixels","commit_stats":{"total_commits":66,"total_committers":20,"mean_commits":3.3,"dds":"0.36363636363636365","last_synced_commit":"5283976c8dda7a2f9a85221aaf2f2a8b3b7a5b42"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Fget-pixels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Fget-pixels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Fget-pixels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scijs%2Fget-pixels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scijs","download_url":"https://codeload.github.com/scijs/get-pixels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744291,"owners_count":20988781,"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","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-08-01T06:01:29.152Z","updated_at":"2025-04-14T03:56:08.521Z","avatar_url":"https://github.com/scijs.png","language":"JavaScript","readme":"get-pixels\n==========\nGiven a URL/path, grab all the pixels in an image and return the result as an [ndarray](https://github.com/mikolalysenko/ndarray).  Written in 100% JavaScript, works both in browserify and in node.js and has no external native dependencies.\n\nCurrently the following file formats are supported:\n\n* `PNG`\n* `JPEG`\n* `GIF`\n\nExample\n=======\n\n```javascript\nvar getPixels = require(\"get-pixels\")\n\ngetPixels(\"lena.png\", function(err, pixels) {\n  if(err) {\n    console.log(\"Bad image path\")\n    return\n  }\n  console.log(\"got pixels\", pixels.shape.slice())\n})\n```\n\nInstall\n=======\n\n    npm install get-pixels\n\n### `require(\"get-pixels\")(url[, type], cb(err, pixels))`\nReads all the pixels from url into an ndarray.\n\n* `url` is the path to the file.  It can be a relative path, an http url, a data url, or an [in-memory Buffer](http://nodejs.org/api/buffer.html).\n* `type` is an optional mime type for the image (required when using a Buffer)\n* `cb(err, pixels)` is a callback which gets triggered once the image is loaded.\n\n**Returns** An ndarray of pixels in raster order having shape equal to `[width, height, channels]`.\n\n**Note** For animated GIFs, a 4D array is returned with shape `[numFrames, width, height, 4]`, where each frame is a slice of the final array.\n\nCredits\n=======\n(c) 2013-2014 Mikola Lysenko. MIT License\n","funding_links":[],"categories":["Repository","JavaScript"],"sub_categories":["Image"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscijs%2Fget-pixels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscijs%2Fget-pixels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscijs%2Fget-pixels/lists"}