{"id":15612490,"url":"https://github.com/kylefox/image-processing","last_synced_at":"2025-04-04T11:42:44.214Z","repository":{"id":2279185,"uuid":"3236250","full_name":"kylefox/Image-Processing","owner":"kylefox","description":"Experimental image processing library in JavaScript.","archived":false,"fork":false,"pushed_at":"2012-01-21T21:36:03.000Z","size":636,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T21:31:50.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylefox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-21T21:22:23.000Z","updated_at":"2013-10-31T10:16:30.000Z","dependencies_parsed_at":"2022-08-19T19:31:28.919Z","dependency_job_id":null,"html_url":"https://github.com/kylefox/Image-Processing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylefox%2FImage-Processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylefox%2FImage-Processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylefox%2FImage-Processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylefox%2FImage-Processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylefox","download_url":"https://codeload.github.com/kylefox/Image-Processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174377,"owners_count":20896074,"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-10-03T06:43:13.088Z","updated_at":"2025-04-04T11:42:44.185Z","avatar_url":"https://github.com/kylefox.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a scratch pad for a JavaScript library (written in CoffeeScript) for processing images. Adjustments are applied to `\u003cimg\u003e` tags by replacing the image with a `\u003ccanvas\u003e`.\n  \nExample:\n========\n\nAssuming your markup contains `\u003cimg id=\"image\" src=\"boat.png\"\u003e` you could do something like this:\n\n    image = new img.Image( document.getElementById('image') );\n    image.setSaturation(.5);\n    image.draw()\n    \nCreating actions\n================\n\nCreate a custom action by subclassing `img.actions.Action` and overriding either the `adjustPixel` or `apply` methods.\n\nAdjusting a single pixel\n------------------------\n\nOverwrite `adjustPixel` if your algorithm simply applies a calculation to a single pixel (for example, greyscale):\n\n    class Greyscale extends img.actions.Action\n    \n      # Parameters: the red, green, blue, and alpha values of the source pixel.\n      # Returns: the new (adjusted) values for the pixel.\n      applyToPixel: (r, g, b, a) -\u003e\n        v = r*0.3 + g*0.59 + b*0.11\n        [v, v, v, 255]\n        \n\nComplex actions\n---------------\n\nIf your action cannot be applied per-pixel (for example, the new value for a pixel depends on the values of its neighbouring pixels) you can override the `apply` method to process the image data however you want:\n\n    class Mosaic extends img.actions.Action\n    \n      # Parameter: the ImageData of the source image (array of pixel values).\n      # Returns: the new (adjusted) array of pixel values.\n      apply: (imageData) =\u003e\n        # Your crazy processing goes here...\n        return imageData\n\n    \nThe code is mostly experimental, but you might find some useful utilities hidden inside. Feel free to fork \u0026 add new stuff, or to repurpose however you see fit.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylefox%2Fimage-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylefox%2Fimage-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylefox%2Fimage-processing/lists"}