{"id":17134332,"url":"https://github.com/brianium/dandy-roll","last_synced_at":"2025-12-12T01:20:14.001Z","repository":{"id":62431344,"uuid":"77289368","full_name":"brianium/dandy-roll","owner":"brianium","description":":rice_scene: Watermarking via ClojureScript","archived":false,"fork":false,"pushed_at":"2017-04-10T01:34:41.000Z","size":342,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-16T06:00:23.241Z","etag":null,"topics":["clojurescript","devcards","watermark-image"],"latest_commit_sha":null,"homepage":"https://brianium.github.io/dandy-roll/#!/dandy_roll.core_test","language":"Clojure","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/brianium.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":"2016-12-24T15:35:55.000Z","updated_at":"2025-03-05T06:31:56.000Z","dependencies_parsed_at":"2022-11-01T21:00:32.230Z","dependency_job_id":null,"html_url":"https://github.com/brianium/dandy-roll","commit_stats":null,"previous_names":["brianium/watermark-cljs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brianium/dandy-roll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fdandy-roll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fdandy-roll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fdandy-roll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fdandy-roll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianium","download_url":"https://codeload.github.com/brianium/dandy-roll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fdandy-roll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270817338,"owners_count":24650973,"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-17T02:00:09.016Z","response_time":129,"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":["clojurescript","devcards","watermark-image"],"created_at":"2024-10-14T19:44:38.818Z","updated_at":"2025-12-12T01:20:13.899Z","avatar_url":"https://github.com/brianium.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dandy Roll\n\n### Current release:\n\n[![Clojars Project](https://img.shields.io/clojars/v/brianium/dandy-roll.svg)](https://clojars.org/brianium/dandy-roll)\n\nAn improved port of [watermark.js](https://github.com/brianium/watermarkjs), Dandy Roll is a ClojureScript library for watermarking images. It is a small layer on top of the HTML canvas API.\n\nMost people immediately point out how useless watermarking in the browser is:\n\n\u003e You can still get the original source of the image by looking at source!\n\nDandy Roll supports watermarking images from all sorts of sources. It can watermark the following types:\n\n* `Image`\n* `HTMLImageElement`\n* `String` - that is a url\n* `File` - that is an uploaded image!\n\nThe only sure fire way to safely watermark an image without exposing the original source is to do so via the `File` type.\n\n## Example\n\nMost of the relevant functions needed are inside `dandy-roll.core`\n\n### Watermarking with an image\n\n```clojure\n;; load a url and watermark it\n(watermark \"/mycat.jpeg\"\n  (with-image \"/logo.png\" lower-right)\n  (append (.-body js/document)))\n\n;; load an image from a file input, watermark it, and upload it\n(def files (array-seq (.-files my-input)))\n\n(defn upload [blob] ,,,)\n\n(watermark (first files)\n  (with-image \"/logo.png\" upper-left)\n  (to-blob upload))\n\n;; watermark an image with lots of credit due\n(watermark \"/mycat.jpeg\"\n  (with-image \"/logo1.png\" lower-right)\n  (with-image \"/logo2.png\" lower-left)\n  (with-image \"/logo3.png\" upper-left)\n  (with-image \"/logo4.png\" upper-right)\n  (with-image \"/logo5.png\" center)\n  (append (.-body js/document)))\n\n;; add alpha transparency\n(watermark \"/mycat.jpeg\"\n  (with-image \"/logo.png\" (lower-right { :alpha 0.4 }))\n  (to-blob upload))\n```\n\n### Watermarking with text\n\nSometimes it's just fun and cool to write text on an image.\n\n```clojure\n(watermark \"lolcat.jpeg\"\n  (with-text \"I CAN HAZ\" 32 \"Impact\" \"#fff\" center-top)\n  (with-text \"CAT MEMEZ?\" 32 \"Impact\" \"#fff\" center-bottom)\n  (append some-element))\n```\n\nKeep in mind, any font families used with text need to be loaded or they\nwill not be applied correctly.\n\n## Tests\n\nI started out using PhantomJS for automated tests, but it seems to be lacking\nin the `Blob` department and ES6 department. Seeing how this library is small\nand very visual, I opted for the amazing [Devcards](https://github.com/bhauman/devcards)\nlibrary by Bruce Hauman. It offers a hot reloaded test environment that doubles down as documentation\nand tests via `cljs.test`\n\nTo run the tests during development just run `lein figwheel devcards-test` and hit `localhost:3449/tests.html`\n\nTo run them right now head to the [standalone devcard deployment](https://brianium.github.io/dandy-roll/) on GitHub pages. Run tests\nfor a namespace by clicking on that namespace's link.\n\n## Documentation\n\nDevcards is my documentation tool as well. The [core test](https://brianium.github.io/dandy-roll/#!/dandy_roll.core_test) not only\ntests the core API, but provides documentation for it as well.\n\n## Todo\n\n* Support Node.js targets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fdandy-roll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianium%2Fdandy-roll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fdandy-roll/lists"}