{"id":13431086,"url":"https://github.com/meltingice/CamanJS","last_synced_at":"2025-03-16T06:32:16.600Z","repository":{"id":1170012,"uuid":"1063498","full_name":"meltingice/CamanJS","owner":"meltingice","description":"Javascript HTML5 (Ca)nvas (Man)ipulation","archived":false,"fork":false,"pushed_at":"2020-02-20T14:45:37.000Z","size":8196,"stargazers_count":3541,"open_issues_count":119,"forks_count":403,"subscribers_count":97,"default_branch":"master","last_synced_at":"2024-05-21T22:18:56.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://camanjs.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meltingice.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}},"created_at":"2010-11-08T23:31:25.000Z","updated_at":"2024-05-12T12:58:16.000Z","dependencies_parsed_at":"2022-07-06T11:00:46.849Z","dependency_job_id":null,"html_url":"https://github.com/meltingice/CamanJS","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltingice%2FCamanJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltingice%2FCamanJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltingice%2FCamanJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meltingice%2FCamanJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meltingice","download_url":"https://codeload.github.com/meltingice/CamanJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835952,"owners_count":20355611,"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-07-31T02:01:00.391Z","updated_at":"2025-03-16T06:32:16.216Z","avatar_url":"https://github.com/meltingice.png","language":"HTML","readme":"# About the Project\n\n**This project is no longer actively maintained. Thanks everyone for the support and interest over the years!**\n\nThe main focus of CamanJS is manipulating images using the HTML5 canvas and Javascript. It's a combination of a simple-to-use interface with advanced and efficient image/canvas editing techniques. It is also completely library independent and can be safely used next to jQuery, YUI, Scriptaculous, MooTools, etc.\n\nCamanJS is very easy to extend with new filters and plugins, and it comes with a wide array of image editing functionality, which is only growing as the community makes more plugins. All features that are not a part of the core CamanJS library are in a [separate plugins repository](https://github.com/meltingice/CamanJS-Plugins).\n\nFor more information, I highly recommend taking a look at the [official website](http://camanjs.com) where there is more comprehensive documentation and interactive demos. You can also [read the wiki](https://github.com/meltingice/CamanJS/wiki) for some basic information about the project and how to use it.\n\nCamanJS is written in [Coffeescript](http://coffeescript.org) as of version 3.0. **It works both in-browser and in NodeJS.**\n\nCamanJS is a project that I work on in purely my own spare time. If you would like to pitch in a beer or donate to say thanks, my Bitcoin address is: 1EVNQ7FiWDaqpfYXRLCtgMe5RBcz3kEuAG\n\n## Usage\n\nInclude one of the versions in the `dist/` folder, then you can run:\n\n```js\nCaman(\"#image-id\", function () {\n  this.brightness(10);\n  this.contrast(20);\n  this.render(function () {\n    alert(\"Done!\");\n  });\n});\n```\n\nCaman also supports modifying images via the `data-caman` HTML attribute. Simply separate each instruction with a space. Images with the `data-caman` attribute will automatically be modified at page load.\n\n```html\n\u003cimg data-caman=\"saturation(-10) brightness(20) vignette('10%')\" src=\"path/to/image.jpg\"\u003e\n```\n\n### HiDPI Support\n\nVersion 4 introduces better support for HiDPI (Retina) displays. It allows you to specify a higher resolution replacement using HTML data attributes. Keep in mind, however, that higher resolution images take longer to render.\n\n**HTML data attributes**\n\n* `data-caman-hidpi`: URL to the high resolution replacement image\n* `data-caman-hidpi-disabled`: HiDPI support is enabled by default, so add this attribute if you wish to force disable it\n\n## Upgrading to Version 4\n\nThere is only 1 breaking change that occured with the version 4 release. When you initialize CamanJS with a canvas and an image, the parameter order has changed. It is now:\n\n``` javascript\nCaman(\"#canvas-id\", \"/path/to/image.png\", function() {});\n```\n\nThis is in order to be more consistent with initialization, such that the \"initialization object\" is always the first parameter. Update your code accordingly.\n\n## Development\n\nIf you are a developer who is contributing directly to the project, there are some tools to help you out.\n\n### Building\n\nTo install all dependencies required for development, run `npm install -d`.\n\nBecause all plugins are in a separate repository, make sure you run:\n\n```\ngit submodule init \u0026\u0026 git submodule update\n```\n\nTo build, simply run `cake build`. The resulting files will be placed in the dist/ folder. Plugins will be automatically discovered and added to caman.full.js after the core library. You can also auto-compile when a file changes by using `cake watch`.\n\nIf you add any files to the core library, you will need to add them to the `coffeeFiles` array in the Cakefile. The point of this is so that order is preserved when generating the file JS file. Plugins do not need to be added to the Cakefile.\n\nYou will probably want to generate documentation if you make any changes. In addition to the normal requirements, you will also need the Python library Pygments.\n\nTo generate the documentation, run `cake docs`.\n\n## CDN JS Hosting\n\nCamanJS is hosted on CDN JS if you're looking for a CDN hosting solution. It is the full and minified version of the library, which means all plugins are included. Simply load CamanJS directly from [this URL](http://cdnjs.cloudflare.com/ajax/libs/camanjs/3.3.0/caman.full.min.js) for usage on your site.\n\n## NodeJS Compatibility\n\nCamanJS is fully compatible with NodeJS. The easiest way to install it is:\n\n```\nnpm install caman\n```\n\n**Saving from NodeJS**\n\nTo save your modified image in NodeJS, simply call the save() function **after** rendering is finished by passing a callback function to `render()`. Trying to save before rendering is finished will cause issues.\n\n``` javascript\nCaman = require('caman').Caman;\n\nCaman(\"./path/to/file.jpg\", function () {\n  this.brightness(40);\n  this.render(function () {\n    this.save(\"./output.png\");\n  });\n});\n```\n\n## Testing\n\nTests for CamanJS run both in NodeJS and the browser.\n\n### NodeJS\n\nThe NodeJS tests use mocha as the test runner. The simplest way to run the test suite is by running `npm test`.\n\n### Browser\n\nThe browser tests are run by Karma. It will start up Chrome, Firefox, and Safari (if running OSX) in the background. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well.\n\nYou can run Karma by running `karma start`, or you can do a single run with the NodeJS tests by running `npm test`.\n","funding_links":[],"categories":["HTML","Programming Languages"],"sub_categories":["JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeltingice%2FCamanJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeltingice%2FCamanJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeltingice%2FCamanJS/lists"}