{"id":18562778,"url":"https://github.com/ruby-processing/filters4ruby-processing","last_synced_at":"2026-01-24T21:38:05.123Z","repository":{"id":32873334,"uuid":"36467508","full_name":"ruby-processing/filters4ruby-processing","owner":"ruby-processing","description":"Translation of Filters4Processing to ruby-processing","archived":false,"fork":false,"pushed_at":"2017-08-17T13:55:16.000Z","size":1717,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-17T12:45:41.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/ruby-processing/filters4ruby-processing/wiki","language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby-processing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-28T21:36:33.000Z","updated_at":"2016-08-15T17:12:15.000Z","dependencies_parsed_at":"2022-09-02T23:01:42.448Z","dependency_job_id":null,"html_url":"https://github.com/ruby-processing/filters4ruby-processing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-processing%2Ffilters4ruby-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-processing%2Ffilters4ruby-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-processing%2Ffilters4ruby-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-processing%2Ffilters4ruby-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby-processing","download_url":"https://codeload.github.com/ruby-processing/filters4ruby-processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388632,"owners_count":22063086,"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-11-06T22:10:51.695Z","updated_at":"2026-01-24T21:38:05.085Z","avatar_url":"https://github.com/ruby-processing.png","language":"GLSL","readme":"filters4ruby-processing\n==================\nA port of [Filters4Processing][] to ruby-processing\nA growing collection of pixel shaders ported to Processing to be used with the `filter()` function. Most of these shaders come from the excellent [Shadertoy](https://www.shadertoy.com) by Iñigo Quilez.\n\n### To run / watch shader sketches \nNB: since ruby-processing-2.6.11 glsl files are also _watched_, so you can edit the shader of the sketch running in\nwatch mode, and it will automatically reload when you save your changes...\n```bash\n# autorun all sketches\ncd filters4ruby-processing\nrake # assume rake and processing and ruby-processing installed\n```\nRun / Watch individual sketches as follows\n```bash\nrp5 --nojruby run/watch sketch.rb # Need to use jruby-complete\n```\nto avoid need for `--nojruby` flag in `.rp5rc` add following (if pure yaml)\n```yaml\nJRUBY: 'false'\n```\nor if you used our configRP5.pde tool (emits json)\n```json\n{\n\"JRUBY\": \"false\",\n....\n}\n```\nNB: delete line, or change back to 'true' when you need to use gems.... \n\nThis is a java/jruby permission thing, and beyond our control\n## Filters\n\n### Barrel Blur Chroma\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/BarrelBlurChroma.jpg)\n\n### Barrel \u0026 Pincushion\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/BarrelPincushion.png)\n\n### Bicubic Filter\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/Bicubic.jpg)\n\n### Bilateral Filter (denoise)\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/Bilateral.jpg)\n\n### Contrast, Saturation, Brightness\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/ConSatBri.jpg)\n\n### Dithering\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/Dithering.jpg)\n\n### Edge filter\n![screenshot](https://github.com/SableRaf/Filters4Processing/blob/master/screenshots/Edge.jpg)\n\n## Usage\n\nThis is a minimal example showing how to import shader file in ruby-processing and use it as a filter.\n\n*Note: Some shaders require additional uniforms. For details, refer to the example sketches included.*\n\n```ruby\nattr_reader :my_filter, :my_image\n\ndef setup\n  size(512, 512, P2D)\n  # import an image object\n  @my_image  = load_image('texture.jpg')\n  # load a shader object\n  @my_filter = load_shader('shader.glsl')\n  # pass the window size to the shader\n  my_filter.set('sketchSize', width.to_f, height.to_f)\nend\n\ndef draw\n  background(0)\n  # Draw the image on the scene\n  image(my_image, 0, 0)\n  # Applies the shader to everything that has already been drawn\n  return if mouse_pressed?\n  filter(my_filter)\nend\n```\n\n## Notes about porting filters from Shadertoy\n\nShadertoy and Processing both have their own quirks when it comes to shader programming. We need to make some changes in order to make Shadertoy code work with Processing/ruby-processing. See [wiki](https://github.com/ruby-processing/filters4ruby-processing/wiki/Translating-shaders-for-processing) which you are welcome to edit if you know better\n\nNow go dig for some [shaders](https://www.shadertoy.com/results?query=filter) and help us extend the library of filters available for Processing/ruby-processing!\n\n*Note: It is possible to port other types of shaders, but this repository focuses on filters.*\n\n## Acknowledgments\nPort to processing by Raphaël de Courville.\nThanks to all the Shadertoy contributors for their hard work. This collection wouldn't exist without them. Thanks to Andr\u0026eacute;s Colubri for his work on the Processing Shader API.\n\n## License\nAll shaders from Shadertoy belong to there respective authors. Unless otherwise specified in the shader file, they are licensed under Creative Commons ([CC BY-NC-SA 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US))\n\n## Tools\n[Syntax highlighting for glsl in vim](https://github.com/beyondmarc/glsl.vim)\n\n[Filters4Processing]:https://github.com/SableRaf/Filters4Processing\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-processing%2Ffilters4ruby-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby-processing%2Ffilters4ruby-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-processing%2Ffilters4ruby-processing/lists"}