* Update PULL_REQUEST_TEMPLATE.md
CHANGING PULL REQUEST TEMPLATE FOR ASKING CONTRIBUTORS TO GET ATLEAST TWO REVIEW TO GET PULL REQUEST MERGED.
* Update .github/PULL_REQUEST_TEMPLATE.md
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* Load image via URL
* notify users for image load failue due to CORS error
* added a check for notifybox
* added some more checks
* added bootstrap version v4 classes
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* fixed registration problem of service worker
* added a test for service worker
* reused some existing code to avoid code duplication
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* use template for commander instance in clitest
* remove unnecessary log
* use named export instead of default
* refactor cli code to another file to make it testable
* refactor cli.js into src/cli
* refactor
* refactor
* refactor
* refactor
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* circular gradient module
* Shadow module added
* fixed minor documentation error
* fixed small errors
* added test for shadow module
* updated shadow module to receive x and y inputs
* final shadow module with two inputs
* fixed test for shadow module
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* Updated config.yml according to plots2 file
* Corrected according to suggestions
* minor change
* minor change
* minor change
* minor change
* minor change
* minor changes
Co-authored-by: sharmamansi <mansisharma785622gmail.com>
Co-authored-by: Rishabh Shukla <42492389+blurry-x-face@users.noreply.github.com>
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
* Split tests into separate Travis jobs with better labeling
* format test browserification
* more descriptive labels
* combine grunt browserify of tests and the run of those tests
* Added options startingX and startingY in Add-Qr Module
* requeste changes
* Fixing Qr Code at the end when not fit in the image
Co-authored-by: Rishabh Shukla <42492389+blurry-x-face@users.noreply.github.com>
The histogram module values are "true" and "false".
jQuery would coerce them to Boolean true and false instead of String
"true" and "false" which would result in empty value being displayed.
Resolves#1295
* add test for change in option for colormap
* add test for change in option for colormap
* add comments
* add few tests
* Add options change test for 14 more modules
* add test
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
* Base file
* Added aspect ratio module
* Compatiable with Experimental GIF Manipulation
* some refactoring
* Changed the name from aspect-ratio to Constrained Crop
* cleanup
* Changes requested
* Added test module
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* fix color picker bug
* minor change
* change step to stepAll
* add test
* add comments to colorpicker UI test
* add space
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* Add version number to bottom
* Get latest version number from GitHub
* Create versionManagement.js
Fetching the latest and local version number is now done through versionManagement.js
* Add popup to prompt for refresh when a new version is available
A new version is available whenever the sw.js file is changed.
* Add version number fixed in top right corner
* Fix Codeclimate issues
* Update versionManagement.js
* Update versionManagement.js
* Make update prompt appear at front of page
Changed z-index
* Delete unecessary code
* Create task to automatically update sw.js
Used grunt-text-replace
* Uninstall semver
* Add replace task to serve and production tasks
* Update demo.js
Make version statements more descriptive.
* Update versionManagement.js
Remove unused versionCompare function
* Change URL for getting latest version
Changed the URL for getting the latest NPM version to be based on the package.json file's attribute for "homepage".
* Update index.html
* Update demo.css
* Added explanatory comments
* Update versionManagement.js
* Update versionManagement.js
* Updates for readability
Changed single-line comments to multiline comments.
* Update versionManagement.js
* Update versionManagement.js
Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
* test for add step
* adding relative path and testing with npm run test-ui(for testing in travis but it will abort previous test-ui)
* checking index.html
* checking index.html
* changing test location and reverting index.html
* remove console.log
* FIX: Dragzone overlapping
Changes:
- inline styles moved from ../ImportImage/Ui.js to demo.css
- minor code improvements
The change was necessary because in the old UI dragzone was overlapping
an image.
Resolves#1294
* FIX: Improve commit #ead4b932
Changes:
- rollback .dropzone input style
- add styles to .import-image-zone input element
* FIX: .import-image-zone input element width
Changes:
- max-width increased to 120% on import-image-zone input element
* FIX: .import-image-zone max-width
Changes:
- rollback .import-image-zone input max-width to fit-content
- increase .import-image-zone max-width from 230px to 250px
* FIX: .import-image-zone input element max-width
Changes:
- max-width set to 100%
* this PR solves the problem of clipping of the image while rotating
* a little clipping was still present .so made the changes
* Splitted into two files
* ommitted extra declared variables
* Update Module.js
* Update Rotate.js
* Update Rotate.js
* Add wasm code
* First working model
* Add PixelManipulation web assembly code to browser and node
* Tests corrected for modules
* Corrected test script
* Add wasm bechmarks
* Update Readme
* Applies toggling functionality and refactored PixelManipulation code
* Added documentation and corrected wasm toggling
* change noise reduction module to use wasm code
* Corrected formatting and removed extra comments
* Add default wasm option and made README changes
* Fixed negative test timings
* combined benchmarks file
* Update benchmark.js
* Removed copies of wasm file and corrected test format
* Update package.json
Co-Authored-By: Jeffrey Warren <jeff@unterbahn.com>
* Added wasm file and removed redundant code
* Removed earlier benchmarks
* move test/core/sequencer/benchmark.js to its own test command, not passing to tape-spec
* Solves memory leaks and blank lines
* Solves memory leaks and blank lines
* Added handler for node code
* Modify test script
* Modify test script
* Correct doc and removed pace fuctionality
* Added Color Picker for selecting RGBA values in modules
* added scripts from node_modules
* selector-all added and alpha removed for some modules
* Modified description
* attempting webgl-distort
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* fixed the error
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* WIP
* custom inputs for distort
* added test suite
* test fix and input parse
* test fix
* 3.3.0
* detecting and parsing string separated module names
* test fix
* parsing multiple input methods
* travis fix
* test cases
* requested changes made
* test fix
* rebase and fix conflicts
* More Modules option removed. Placeholder text added
* 'A' changed to 'a' in placeholder text
* Update examples/lib/intermediateHtmlStepUi.js
Suggested update
Co-Authored-By: teisenhower <47988669+teisenhower@users.noreply.github.com>
* Removed redundant parameters in ImageSequencer.js
* Re-added loadImages, deleted loadImage
* Left both loadImage and loadImages in
I think I need more details to the last phrase in the instructions, telling me to remove the export of loadImages, I tried deleting that line and cannot pass the test.
* The cursor changes to pointer when hovered over select element
* Cursor to pointer changes added to demo.css
* adding csrtoptr class directly to dist file
* small bug in ui fixed through bootstrap
* small bug in ui fixed through bootstrap
* Fixed unresponsive bug in ui with bootstrap
* all changes have been deleted regarding the cursor bug. only unresponsive bug has been solved
* Update Readme.md that includes importJSON docs
* Adds command JSON object step addition format to README.md
* Added reference to the appropriate test
* Resolved missing rebase
* Deleted images in test_outputs directory and put it in .gitignore file
* Update "Installation" section of README.md
The following changes make the section more concise by removing unnecessary words.
* Update README.md
* Updated README.md further
-made additional grammatical and word choice improvements
* Update index.html
added bootstrap classes btn brn-default btn-md for Take a photo button
* changed brn-default btn-primary
* changed button color and size
* Adds Add QR module
* Grunt build changes
* Rremoved copyPixels function and added test for QR module
* Resolved test fail issues
* Adds look same test
* Change default to get from info.json
* Added the resize module
* Added the resize quick button
* Made the icon to fit into the box
* Added the footer to the main page
* Added the resize quick button
* Added the resize quick button
* Added the resize quick button
* default sequencer ui test
* default step ui test suite
* intermediate step ui test
* preview ui test suite
* url methods test suite
* add set url params method test suite
* argument call tests
* test directory refactor
* travis fix
* Update demo.css
removed padding only on sliders -- added the attribute selector [type="range"] on the demo.css file.
* Update demo.css
removed space between .form-control and [type="range"] -- pull request review.
* Replace dropzone id with dropzone class
* Added dropzone class to div container
* Updated dropZone listener
* Changed #dropzone input to .dropzone input
* fixed fastie
* fixed greyscale (#593)
* add local to locally stored modules (#596)
* Add drawing rectangles module (#566)
* add drawing rectangle module
* changes
* White balance module (#585)
* white baalance module
* improved algorithm
* limit check
* Ability to set background color when "over cropping" to enlarge canvas (#563)
* ability to set background color when over cropping to enlarge canvas
* changes
* Clarify that saved sequence will only be available in this browser (#587)
* clarify that saved sequence will only be available in this browser
* changes
* changes
* changes
* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)
* Add manifest.json and cache static assets for offline use (#331)
* Add manifest.json
* cache static assets for offline use
* update cache
* add meta theme-color and change static files to be cache
* cache the files on network request
* caching on first run
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* add a button to clear cache
* add styling to clear cache link
* Update Modules.js (#452)
I've arranged the modules in alphabetical order.
* Added a function to parse Input coordinates and added the functionality for crop and overlay modules
* Added changed dist files
* Revert "Added changed dist files"
This reverts commit dbda25a228.
* Changed function name and added the functionaity to src/utils folder
* Added unit test
* Added unit test to /test/util
* Add border thickness and color in DrawRectangle module (#602)
* added border thickness functionality
* add color functionality
* Bump tape from 4.9.1 to 4.9.2 (#579)
Bumps [tape](https://github.com/substack/tape) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/substack/tape/releases)
- [Commits](https://github.com/substack/tape/compare/v4.9.1...v4.9.2)
Signed-off-by: dependabot[bot] <support@dependabot.com>
* Bump looks-same from 4.1.0 to 5.0.1 (#559)
Bumps [looks-same](https://github.com/gemini-testing/looks-same) from 4.1.0 to 5.0.1.
- [Release notes](https://github.com/gemini-testing/looks-same/releases)
- [Changelog](https://github.com/gemini-testing/looks-same/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gemini-testing/looks-same/compare/v4.1.0...v5.0.1)
Signed-off-by: dependabot[bot] <support@dependabot.com>
* Bump jsqr from 0.2.2 to 1.1.1 (#532)
Bumps [jsqr](https://github.com/cozmo/jsQR) from 0.2.2 to 1.1.1.
- [Release notes](https://github.com/cozmo/jsQR/releases)
- [Commits](https://github.com/cozmo/jsQR/commits)
Signed-off-by: dependabot[bot] <support@dependabot.com>
* Update color drop down (#595)
* updated drop down
* fixed greyscale (#593)
* add local to locally stored modules (#596)
* Add drawing rectangles module (#566)
* add drawing rectangle module
* changes
* White balance module (#585)
* white baalance module
* improved algorithm
* limit check
* Ability to set background color when "over cropping" to enlarge canvas (#563)
* ability to set background color when over cropping to enlarge canvas
* changes
* Clarify that saved sequence will only be available in this browser (#587)
* clarify that saved sequence will only be available in this browser
* changes
* changes
* changes
* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)
* Add manifest.json and cache static assets for offline use (#331)
* Add manifest.json
* cache static assets for offline use
* update cache
* add meta theme-color and change static files to be cache
* cache the files on network request
* caching on first run
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* add a button to clear cache
* add styling to clear cache link
* Update Modules.js (#452)
I've arranged the modules in alphabetical order.
* Added a function to parse Input coordinates and added the functionality for crop and overlay modules
* Added changed dist files
* Revert "Added changed dist files"
This reverts commit dbda25a228.
* Changed function name and added the functionaity to src/utils folder
* Added unit test
* Added unit test to /test/util
* Add border thickness and color in DrawRectangle module (#602)
* added border thickness functionality
* add color functionality
* rebuild
* updated drop down
* fixed greyscale (#593)
* add local to locally stored modules (#596)
* Add drawing rectangles module (#566)
* add drawing rectangle module
* changes
* White balance module (#585)
* white baalance module
* improved algorithm
* limit check
* Ability to set background color when "over cropping" to enlarge canvas (#563)
* ability to set background color when over cropping to enlarge canvas
* changes
* Clarify that saved sequence will only be available in this browser (#587)
* clarify that saved sequence will only be available in this browser
* changes
* changes
* changes
* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)
* Add manifest.json and cache static assets for offline use (#331)
* Add manifest.json
* cache static assets for offline use
* update cache
* add meta theme-color and change static files to be cache
* cache the files on network request
* caching on first run
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* add a button to clear cache
* add styling to clear cache link
* Update Modules.js (#452)
I've arranged the modules in alphabetical order.
* Added a function to parse Input coordinates and added the functionality for crop and overlay modules
* Added changed dist files
* Revert "Added changed dist files"
This reverts commit dbda25a228.
* Changed function name and added the functionaity to src/utils folder
* Added unit test
* Added unit test to /test/util
* Add border thickness and color in DrawRectangle module (#602)
* added border thickness functionality
* add color functionality
* Add manifest.json and cache static assets for offline use (#331)
* Add manifest.json
* cache static assets for offline use
* update cache
* add meta theme-color and change static files to be cache
* cache the files on network request
* caching on first run
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* add a button to clear cache
* add styling to clear cache link
* Update Modules.js (#452)
I've arranged the modules in alphabetical order.
* Added a function to parse Input coordinates and added the functionality for crop and overlay modules
* Added changed dist files
* Revert "Added changed dist files"
This reverts commit dbda25a228.
* Changed function name and added the functionaity to src/utils folder
* Added unit test
* Added unit test to /test/util
* added icons, rearranging
* basic framework for addstep modules
* linked buttons to automatic step addition
* Delete package-lock.json
* rounded buttons and text movement in image sequencer select
* made null option visible in select dropdown
* package-lock.json
* Add manifest.json
* cache static assets for offline use
* update cache
* add meta theme-color and change static files to be cache
* cache the files on network request
* caching on first run
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* add a button to clear cache
* add styling to clear cache link
* added resize module - without test
* Added resize test, deleted unused value in blend test (which I've added before)
* Fixed test
* Fixed test
* added modules file
* added imagejs to package
* removed test - not able to check width and height of the element
* Changed resize calculations
* Add configurable parameter for blend module to chose image
* Made minor changes
* Edit test to work with new parameter
* blend offset test added
* blend offset test added
* fixed blend offset test
* Added scripts in package.json to fix installation
* Update setup script
* Update README.md
Add installation instructions for windows
* Update README.md
added headers for windows and Unix
* Add matrix math module
* add info.json file
* correct format of module
* Add a constant factor input field
* clone the pixels array
* change default values
* Add placeholder option to input , change type of brightness input to number
Changes to be committed:
modified: examples/lib/defaultHtmlStepUi.js
modified: src/modules/Brightness/info.json
* change 0% to 0 in brightness placeholder
* test import string with no configs
* now working without ()
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* update test
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* refactor for readability
* refactor for pipes | between multiple step settings
* fixed bugs
* test fixed
* demo images can be downloaded by clicking
* modified download to extract image type from url
* refactored image output into standalone function
* updated to call fileExtension function
* fixed blur module as well as issue with no output when running debug
* added saturation module
* fixing requested changes
* fixing exportBin
* requested fixes
* resolves#133 add -b --basic mode to only output final image update readme
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
* format logs and help
* update dist files
title: 'Checklist and coordination for v0.0.0 major/minor/patch release'
labels: release
assignees: '@publiclab/is-maintainers'
---
This template guides us through the steps of creating a new release, based on conversation and testing in [#1692](https://github.com/publiclab/image-sequencer/issues/1692).
Discuss with @publiclab/is-maintainers if anything is ambiguous!
<!-- NOTE: Change v0.0.0 to the appropriate release version -->
* [x] open an issue using the "release" template with this checklist with title `Checklist and coordination for v0.0.0 major/minor/patch release` (see [semantic versioning](https://docs.npmjs.com/about-semantic-versioning/))
* [ ] create a release draft in https://github.com/publiclab/image-sequencer/releases
* [ ] auto-compile release notes and copy below from corresponding release draft
* [ ] open a pull request with updated version numbers
* [ ] update version number in `package.json` (ex #1695)
* [ ] update version number in `examples/sw.js` (ex #1734)
* [ ] run `npm install` to update `package-lock.json` (from recent node version - 16 at time of writing, in GitPod should work)
* [ ] check in `package-lock.json`
* [ ] finalize and merge to `main` branch (freeze merges to `main` branch until next step)
Now, move to `stable` branch:
* [ ] force push from `main` to `stable`
* [ ] then in `stable` branch, compile `dist/` files with `grunt build`
* [ ] add `dist/` files with `git add -f dist/*` and commit them to `stable` branch
* [ ] publish `stable` branch to `npm` with `npm publish` (logging in first as necessary)
Draft a release:
* [ ] [create a release on GitHub](https://github.com/publiclab/image-sequencer/releases) and reconcile with features description + release notes from below
* [ ] tag version number branch (i.e. `v0.0.0`) based on `stable` or choose `stable`
* [ ] publish to live Github pages [demo](https://sequencer.publiclab.org) (with [bash script](https://github.com/publiclab/image-sequencer/pull/1703) from `/scripts/update-demo`) (from within GitPod works well)
* [ ] move anything necessary to next release project, i.e. <!-- Update this link -->https://github.com/publiclab/image-sequencer/projects/[insert project number]
* [ ] close this issue!
Noting we're now in this process in https://github.com/publiclab/image-sequencer/issues/1751 for `v3.7.0`.
****
### Release notes
Compile and edit release notes below, to be copied into the release description.
# Configuration for welcome - https://github.com/behaviorbot/welcome
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment:|
Thanks for opening your first issue here! This space is [protected by our Code of Conduct](https://publiclab.org/conduct) - and we're here to help.
Please follow the issue template to help us help you 👍🎉😄
If you have screenshots to share demonstrating the issue, that's really helpful! 📸 You can [make a gif](https://www.cockos.com/licecap/) too!
Don't forget to join our [PublicLab Gitter channel](https://gitter.im/publiclab/publiclab) and our [ImageSequencer Gitter Channel](https://gitter.im/publiclab/image-sequencer) for some brainstorming discussions.
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment:|
Thanks for opening this pull request! This space is [protected by our Code of Conduct](https://publiclab.org/conduct).
There may be some errors, **but don't worry!** We're here to help! 👍🎉😄
Also please refer (https://github.com/publiclab/image-sequencer/blob/main/README.md) for installation help.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment:|
Congrats on merging your first pull request! 🙌🎉⚡️
Your code will be published to https://beta.sequencer.publiclab.org in a day or two. Please test out your work on this testing server and report back with a comment that all has gone well!
In the meantime, can you tell us your Twitter handle so we can thank you properly also do join our weekly check-in to share your this week goal and the awesome work you did 😃.
Please find the link **pinned in the issue section**
Now that you've completed this, you can help someone else take their first step! Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕
People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉
Hi, this is a [first-timers-only issue](https://code.publiclab.org/#r=all). This means we've worked to make it more legible to folks who either **haven't contributed to our codebase before, or even folks who haven't contributed to open source before**.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝
If you have contributed before, **consider leaving this one for someone new**, and looking through our general [help wanted](https://github.com/publiclab/image-sequencer/labels/help-wanted) issues. Thanks!
### 🤔 What you will need to know.
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
### 📋 Step by Step
- [ ] 🙋 **Claim this issue**: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
- [ ] 📝 **Update** the file [$FILENAME]($BRANCH_URL) in the `$REPO` repository (press the little pen Icon) and edit the line as shown below.
[See this page](https://code.publiclab.org/#r=all) for some help in taking your first steps!
Below is a "diff" showing in red (and a `-`) which lines to remove, and in green (and a `+`) which lines to add:
```diff
$DIFF
```
- [ ] 💾 **Commit** your changes
- [ ] 🔀 **Start a Pull Request**. There are two ways how you can start a pull request:
1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.
2. You can also [edit files directly in your browser](https://help.github.com/articles/editing-files-in-your-repository/) and open a pull request from there.
- [ ] 🏁 **Done** Ask in comments for a review :)
### Please keep us updated
💬⏰ - We encourage contributors to be respectful to the community and provide an update **within a week** of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!
If this happens to you, don't sweat it! Grab another open issue.
### Is someone else already working on this?
🔗- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.
👥- **If someone seems stuck, offer them some help!** Otherwise, [take a look at some other issues you can help with](https://code.publiclab.org/#r=all). Thanks!
_Public Lab, 55 Cromwell Street, 1C, Providence, RI 02907_
We are coming together with an intent to care for ourselves and one another as we produce knowledge in pursuit of environmental justice. For this to work for everybody, individual decisions will not be allowed to run counter to the welfare of other people. We—visitors, community members, community moderators, staff, organizers, sponsors, and all others—hold ourselves accountable to the same values regardless of position or experience. This community aspires to be a respectful place both during online and in-person interactions so that all people are able to fully participate with their dignity intact. This document is a piece of the culture we're creating.
This code of conduct applies to all spaces managed by the Public Lab community and non-profit, both online and in person. It provides a clear set of practical guidelines for events led by organizers and community members, multi-day events such as Barnraisings, and online venues such as the website, comment threads on software platforms, chatrooms, our mailing lists, the issue tracker, and any other forums created by Public Lab which the community uses for communication. For interactions with additional groups, see our Partnership Guidelines at https://publiclab.org/partners.
To read the full Code of Conduct and learn how to contact the Conduct Committee or the Moderators group, see:
See [this issue](https://github.com/publiclab/image-sequencer/issues/118) for a range of ideas for new contributions, and links to possibly helpful libraries. Also see the [new features issues list](https://github.com/publiclab/image-sequencer/labels/new-feature).
See [this issue](https://github.com/publiclab/image-sequencer/issues/118) for a range of ideas for new contributions and links to possibly helpful libraries, or you can solve an [existing issue](https://github.com/publiclab/image-sequencer/labels/module). Also see the [new features issues list](https://github.com/publiclab/image-sequencer/labels/new-feature).
### Bugs
@@ -25,26 +33,27 @@ If you find a bug please list it here, and help us develop Image Sequencer by [o
## Contributing modules
Most contributions can happen in modules, rather than to core library code. Modules and their [corresponding info files](#info-file) are included into the library in this file: https://github.com/publiclab/image-sequencer/blob/master/src/Modules.js#L5-L7
Most contributions can happen in modules, rather than to core library code. Modules and their [corresponding info files](#info-file) are included into the library in this file: https://github.com/publiclab/image-sequencer/blob/main/src/Modules.js#L5-L7
Module names, descriptions, and parameters are set in the `info.json` file -- [see below](#info-file).
Any module must follow this basic format:
```js
module.exports=functionModuleName(options,UI){
options=options||{};
options.title="Title of the Module";
UI.onSetup(options.step);
varoutput;
// Module requirements have been simplified in version 3, see https://github.com/publiclab/image-sequencer/blob/master/CONTRIBUTING.md#contributing-modules
functiondraw(input,callback){
UI.onDraw(options.step);
varoutput=/*do something with the input*/;
varoutput=function(input){
/* do something with the input */
returninput;
}
this.output=output;
options.step.output=output.src;
this.output=output(input);// run the output and assign it to this.output
callback();
UI.onComplete(options.step);
}
return{
@@ -56,6 +65,73 @@ module.exports = function ModuleName(options,UI) {
}
```
Image Sequencer modules are designed to be run either in the browser or in a Node.js environment. For dynamically loaded modules, that means that any uses of `require()` to include an external library must be compiled using a system like `browserify` or `webpack` to ensure browser compatibility. An example of this can be found here:
https://github.com/tech4gt/image-sequencer
### Browser/node compatibility
If you wish to offer a module without browser-compatibility, please indicate this in the returned `info` object as:
module.exports = [
ModuleName,
{ only: ['node'] }
];
If you believe that full cross-compatibility is possible, but need help, please open an issue on your module's issue tracker requesting assistance (and potentially link to it from an inline comment or the module description).
Any Independent Module Must follow this basic format
```js
functionModuleName(options,UI){
varoutput;
functiondraw(input,callback){
varoutput=function(input){
/* do something with the input */
returninput;
}
this.output=output(input);// run the output and assign it to this.output
callback();
}
return{
options:options,
draw:draw,
output:output,
UI:UI
};
}
module.exports=[ModuleName,{
"name":"ModuleName",
"description":"",
"inputs":{
// inputs here
}
/* Info can be defined here or imported from a json file */
// require('./info.json') This only works in node
// In a module compiled with browserify or webpack, a require() can be used to
// load a standard info.json file.
];
```
### Running a browser-only module in node
If your module has browser specific code or you are consuming a dependency which does the `gl-context` api. We designed this api especially for webl based modules but since it runs the module in a headless browser, ti supports all browser specific APIs.
The object `options` stores some important information. This is how you can accept
@@ -67,6 +143,28 @@ whether your module is being run on a browser.
### draw()
To add a module to Image Sequencer, it must have a `draw` method; you can wrap an existing module to add them:
*`module.draw(input, callback)`
The `draw` method should accept an `input` parameter, which will be an object of the form:
```js
input={
src:"datauri of an image here",
format:"jpeg/png/etc",
// utility functions
getPixels:"function to get Image pixels. Wrapper around https://npmjs.com/get-pixels",
savePixels:"function to save Image pixels. Wrapper around https://npmjs.com/save-pixels",
lodash:"wrapper around lodash library, https://github.com/lodash",
dataUriToBuffer:"wrapper around https://www.npmjs.com/package/data-uri-to-buffer",
pixelManipulation:"general purpose pixel manipulation API, see https://github.com/publiclab/image-sequencer/blob/master/src/modules/_nomodule/PixelManipulation.js"
}
```
For example usage of pixelManipulation see https://github.com/publiclab/image-sequencer/blob/main/src/modules/Invert/Module.js
**The module is included in the browser inside a script tag and since the code runs directly in the browser if any other module is required apart from the apis available on the input object, it should be either bundled with the module code and imported in es6 format or the module code must be browserified before distribution for browser**
The draw method is run every time the step is `run` using `sequencer.run()`.
So any calculations must go **into** the `draw()` method's definition.
@@ -82,44 +180,33 @@ constant definitions must be done **outside** the `draw()` method's definition.
format: "<png|jpeg|gif>"
}
```
* `callback` is a function which is responsible to tell the sequencer that the
step has been "drawn".
* `callback` is a function which is responsible to tell the sequencer that the step has been "drawn".
When you have done your calculations and produced an image output, you are required
to set `this.output` to an object similar to what the input object was, call
`callback()`, and set `options.step.output` equal to the output DataURL
When you have done your calculations and produced an image output, you are required to set `this.output` to an object similar to what the input object was, call `callback()`, and set `options.step.output` equal to the output DataURL
* `progressObj` is an optional additional Object that can be passed in the format `draw(input, callback, progressObj)`, which handles the progress output; see [Progress reporting](#progress-reporting) below.
### UI Methods
The module is responsible for emitting various events for the UI to capture. There are
four events in all:
The module is responsible for emitting various events for the UI to capture.
There are four events in all:
* `UI.onSetup(options.step)` must be emitted when the module is added. So it must be emitted outside the draw method's definition as shown above.
* `UI.onDraw(options.step)` must be emitted whenever the `draw()` method is called. So it should ideally be the first line of the definition of the `draw` method.
* `UI.onComplete(options.step)` must be emitted whenever the output of a draw call
is ready. An argument, that is the DataURL of the output image must be passed in.
* `UI.onRemove(options.step)` is emitted automatically and the module should not emit it.
* `UI.notify(msg,id)` must be emmited when a notification has to be produced.
To add a module to Image Sequencer, it must have the following method; you can wrap an existing module to add them:
### Name and description
* `module.draw()`
The `draw(input,callback)` method should accept an `input` parameter, which will be an object of the form:
```js
input = {
src: "datauri here",
format: "jpeg/png/etc"
}
```
### options.title
For display in the web-based UI, each module may also have a title `options.title`.
For display in the web-based demo UI, set the `name` and `description` fields in the `info.json` file for the module.
## Info file
All module folders must have an `info.json` file which looks like the following:
```json
{
"name": "Name of Module to be displayed",
@@ -155,10 +242,240 @@ Similarly, "Select" type inputs should have a `values` array.
Also, A module may have output values. These must be defined as shown above.
### Progress reporting
The default "loading spinner" can be optionally overriden with a custom progress object to draw progress on the CLI, following is a basic module format for the same:
```js
module.exports = function ModuleName(options,UI) {
var output;
function draw(input,callback,progressObj) {
/* If you wish to supply your own progress bar you need to override progressObj */
progressObj.stop() // Stop the current progress spinner
progressObj.overrideFlag = true; // Tell image sequencer that you will supply your own progressBar
/* Override the object and give your own progress Bar */
progressObj = /* Your own progress Object */
var output = function(input){
/* do something with the input */
return input;
};
this.output = output();
callback();
}
return {
options: options,
draw: draw,
output: output,
UI: UI
}
}
```
The `progressObj` parameter of `draw()` is not consumed unless a custom progress bar needs to be drawn, for which this default spinner should be stopped with `progressObj.stop()` and image-sequencer is informed about the custom progress bar with `progressObj.overrideFlag = true;` following which this object can be overriden with custom progress object.
### Module example
See existing module `green-channel` for an example: https://github.com/publiclab/image-sequencer/tree/master/src/modules/GreenChannel/Module.js
See existing module `channel` for an example: https://github.com/publiclab/image-sequencer/blob/main/src/modules/Channel/Module.js
The `green-channel` module is included into the core modules here: https://github.com/publiclab/image-sequencer/blob/master/src/Modules.js#L5-L7
The `channel` module is included into the core modules here: https://github.com/publiclab/image-sequencer/blob/main/src/Modules.js#L5-L7
For help integrating, please open an issue.
## Meta Module
IMAGE SEQUENCER supports "meta modules" -- modules made of other modules. The syntax and structure of these meta modules is very similar to standard modules. Sequencer can also genarate meta modules dynamically with the function `createMetaModule` which can be called in the following ways
```js
/* Mapping function is a function which gets the inputs of the module as argument
* and returns an array with steps mapped to their options
* See https://github.com/publiclab/image-sequencer/blob/main/src/modules/Colorbar/Module.js for example
*/
/* Module options is an object with the following keys
All of the above can also be combined together to form a single file module.
```js
// MetaModule.js
module.exports =
sequencer.createMetaModule(
function mapFunction(options) {
return [
{ 'name': 'module-name', 'options': {} },
{ 'name': 'module-name', 'options': {} },
];
}, {
infoJson: {
"name": "meta-moduleName",
"description": "",
"inputs": {
}
}
});
```
## Linting
We are now using `eslint` and `husky` to help lint and format our code each time we commit. Eslint defines coding standards and helps in cleaning up the code. To run eslint for checking errors globally or within a specific file run:
```
npx eslint .
npx eslint <file path>
```
And to fix those errors globally or in a file, run these in your terminal:
```
npx eslint . --fix
npx eslint <file path> --fix
```
Be sure to not include the angular brackets(<>).
Husky ensures automation of the above steps with git-hooks(eg. git add,git commit..). However we don't want to check and fix changes of the entire codebase with each commit and that the fixes made by eslint appear unstaged and require us to commit them again and that is where lint-staged helps.
If we want `husky` to not verify the commit and push it anyway, use `git commit -m "message" --no-verify.`
## Grunt Tasks
This repository has different grunt tasks for different uses. The source code is in the [Gruntfile](https://github.com/publiclab/image-sequencer/blob/main/Gruntfile.js).
The following command is used for running the tasks: `grunt [task-name]`. Here `[task-name]` should be replaced by the name of the task to be run. To run the default task run `grunt` without any options.
#### Tasks
1. **compile**: Compiles/Browserifies the dist files in `/dist/image-sequencer.js` and `/dist/image-sequencer-ui.js`.
2. **build**: Compiles the files as in the **compile** task and minifies/uglifies dist files in `/dist/image-sequencer.min.js` and `/dist/image-sequencer-ui.min.js`.
3. **watch**: Checks for any changes in the source code and runs the **compile** task if any changes are found.
4. **serve**: Compiles the dist files as in the **compile** task and starts a local server on `localhost:3000` to host the demo site in `/examples/` directory. Also runs the **watch** task.
5. **production**: Compiles and minifies dist files in `/dist/image-sequencer.js` and `/dist/image-sequencer-ui.js` without the `.min.js` extension to include minified files in the demo site. This script should only be used in production mode while deploying.
6. **default**: Runs the **watch** task as default.
## UI Helper Methods
### scopeQuery
###### Path: `/examples/lib/scopeQuery.js`
The method returns a scoped `jQuery` object which only searches for elements inside a given scope (a DOM element).
To use the method,
* import the `scopeSelector` and `scopeSelectorAll` methods from `lib/scopeQuery.js`
* call the methods with scope as a parameter
```js
var scopeQuery = require('./scopeQuery');
var $step = scopeQuery.scopeSelector(scope),
$stepAll = scopeQuery.scopeSelectorAll(scope);
```
This will return an object with a constructor which returns a `jQuery` object (from inside the scope) but with new `elem` and `elemAll` methods.
#### Methods of the Returned Object
* `elem()`: Selects an element inside the scope.
* `elemAll()`: Selects all the instances of a given element inside the scope.
* `getScope()`: Returns the scope as a DOM element.
* `getDomElem()`: Returns the scoped element as a DOM element instead of a jquery object.
#### Example
```js
//The scope is a div element with id=“container“ and there are three divs in it
//with ids „1“, „2“, and „3“, and all of them have a „child“ class attribute
var $step = require('./scopeQuery').scopeSelector(document.getElementById('container'));
$step('#1'); // returns the div element with id=“1“
$step('#1').hide().elemAll('.child').fadeOut(); // abruptly hides the div element with id=“1“ and fades out all other div elements
```
These two methods are chainable and will always return elements from inside the scope.
#### Usage
Instead of using
```js
$(step.ui.querySelector('query')).show().hide();
$(step.ui.querySelectorAll('q2')).show().hide();
```
The following code can be used
```js
$step('query').show().hide();
$stepAll('q2').show().hide();
```
## Scripts
The following shell scripts are present in the `scripts/` directory.
- `update-gh-pages`: This script can be used to update the `gh-pages` branch of this repo or a fork.
This script is not meant to be used directly as it runs in the current working directory.
If you run it on your primary local clone, it can **delete** the local changes. This script is made to be used in a github action
or in a temporary directory via another script, such as `update-demo`.
Arguments:
1. Repo(to use as upstream) url in the form username/repo (default: publiclab/image-sequencer) NOTE: Github only
2. Branch to pull from eg: main or stable (default: stable)
3. CNAME URL (default: none)
4. Set the fourth argument to anything to bypass the warning. You will have to set this argument if you want to run this script in another script without needing
user interaction, such as in a github action.
- `update-demo`: A safe, interactive script that can be used to update the `gh-pages` branch of any image-sequencer fork.
This script is safe to use directly because it separately clones the repo in a temporary directory.
Arguments: None since it is a an *interactive* script, ie it asks the user for input.
Begin running (and contributing to) this codebase immediately with [GitPod](https://gitpod.io) (this also opens the latest `main` branch code):
[](https://gitpod.io/#https://github.com/publiclab/image-sequencer)
## Why
Image Sequencer is different from other image processing systems in that it's _non-destructive_: instead of modifying the original image, it **creates a new image at each step in a sequence**. This is because it:
Image Sequencer is different from other image processing systems because it's _non-destructive_: instead of modifying the original image, it **creates a new image at each step in a sequence**. This is because it:
* produces a legible trail of operations, to "show your work" for evidential, educational, or reproducibility reasons
* makes the creation of new tools or "modules" simpler -- each must accept an input image, and produce an output image
* allows many images to be run through the same sequence of steps
* works identically in the browser, on Node.js, and on the commandline
* allows many images to run through the same sequence of steps
* works identically in the browser, on Node.js, and on the commandline
* filter-like image processing -- applying a transform to any image from a given source, like a proxy. I.e. every image tile of a satellite imagery web map
* test-based image processing -- the ability to create a sequence of steps that do the same task as some other image processing tool, provable with example before/after images to compare with
* logging of each step to produce an evidentiary record of modifications to an original image
* filter-like image processing -- apply a transform to an image from a given source, like a proxy. I.e. [every image tile of a satellite imagery web map](https://publiclab.org/notes/warren/05-10-2018/prototype-filter-map-tiles-in-real-time-in-a-browser-with-imagesequencer-ndvi-landsat)
* test-based image processing -- the ability to create a sequence of steps that do the same task as other image processing tools, provable with example before/after images to compare with
* logging each step -- to produce an evidentiary record of modifications to an original image
* cascading changes -- change an earlier step's settings, and see those changes affect later steps
* "small modules"-based extensibility: see [Contributing](https://github.com/publiclab/image-sequencer/blob/master/CONTRIBUTING.md)
* "small modules" -- based extensibility: see [Contributing](https://github.com/publiclab/image-sequencer/blob/main/CONTRIBUTING.md)
This library works in the browser, in Node, and on the commandline (CLI), which we think is great.
This library conveniently works in the browser, in Node, and on the commandline (CLI).
### Unix based platforms
You can set up a local environment to test the UI with `sudo npm run setup` followed by `npm start`.
### Windows
Our npm scripts do not support windows shells, please run the following snippet in PowerShell.
```powershell
npmi;npmi-ggruntgrunt-cli;gruntbuild;gruntserve
```
In case of a port conflict please run the following
```powershell
npmi-ghttp-server;http-server-p3000
```
### Online one-click setup for contributing
Contribute to ImageSequencer using a fully featured online development environment that will automatically: clone the repo, install the dependencies and start the webserver.
[](https://gitpod.io/from-referrer/)
### Browser
Just include [image-sequencer.js](https://publiclab.github.io/image-sequencer/dist/image-sequencer.js) in the Head section of your web page. See the [demo here](https://publiclab.github.io/image-sequencer/)!
Just include [image-sequencer.min.js](https://github.com/publiclab/image-sequencer/blob/stable/dist/image-sequencer.min.js) in the Head section of your web page. See the [demo here](https://sequencer.publiclab.org)!
### Node (via NPM)
(You must have NPM for this)
Add `image-sequencer` to your list of dependancies and run `$ npm install`
Add `image-sequencer` to your list of dependencies and run `npm install`
Since Image Sequencer uses data-urls, you can initiate a new sequence by providing an image in the [data URL format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs), which will import into the demo and run:
[Try this example link with a very small Data URL](http://sequencer.publiclab.org/examples/#src=data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z&steps=invert{})
To produce a data URL from an HTML image, see [this nice blog post with example code](https://davidwalsh.name/convert-image-data-uri-javascript).
## CLI Usage
Image Sequencer also provides a CLI for applying operations to local files. The CLI takes the following arguments:
`save-sequence` option can be used to save a sequence and the associated options for later usage. You should provide a string which contains a name of the sequence space separated from the sequence of steps which constitute it.
`install-module` option can be used to install new modules from npm. You can register this module in your sequencer with a custom namespace separated with the npm package name. Below is an example of the `image-sequencer-invert` module.
If only one module is to be added, `modules` is simply the name of the module.
If multiple images are to be added, `modules` is an array of the names of modules
which are to be added, in that particular order.
If multiple images are to be added, `modules` is an array, which holds the names of modules
to be added, in that particular order.
optional_otions is just additional parameters, in object form, which you might
want to provide to the modules. It's an optional parameter.
optional_options is just an optional parameter, in object form, which you might
want to provide to the modules.
A variety of syntaxes are supported by Image Sequencer to add multiple steps and configurations quickly for module chaining. The project supports the string syntax, designed to be compact and URL friendly, and JSON, for handling more complex sequences. This can be achieved by passing strings to `sequencer.addStep()`:
```js
sequencer.addSteps('invert,channel');
sequencer.addSteps(['invert','channel']);
```
For passing default configurations ({} is optional):
The `loadNewModule` method can be used to import a new module inside the sequencer. Modules can be downloaded via npm, yarn or CDN and are imported with a custom name. If you wish to load a new module at runtime, it will need to avoid using `require()` -- unless it is compiled with a system like browserify or webpack.
```js
constmodule=require('sequencer-moduleName')
sequencer.loadNewModule('moduleName',module);
```
## Method Chaining
Methods can be chained on the Image Sequencer:
* loadImage()/loadImages() can only terminate a chain.
* run() can not be in the middle of the chain.
* If the chain starts with loadImage() or loadImages(), the following methods are
applied only to the newly loaded images.
* If no name is provided to the image, a name will be generated for it. The name will
be of the form "image<number>". For ex: "image1", "image2", "image3", etc.
If no Image Name is specified, the module is added to **all** images.
returns an array of steps associated with the current sequencer.
## Saving Sequences
IMAGE SEQUENCER supports saving a sequence of modules and their associated settings in a simple string syntax. These sequences can be saved in the local storage of the browser and inside a JSON file in node.js. sequences can be saved in node context using the CLI option
```shell
--save-sequence "name stringified-sequence"
```
In Node and the browser the following function can be used
```js
sequencer.saveSequence(name,sequenceString)
```
The function `sequencer.loadModules()` reloads the modules and the saved sequences into `sequencer.modules` and `sequencer.sequences`
## String syntax
Image sequencer supports stringifying a sequence which is appended to the url and hence can then be shared. An example below shows the string syntax for `channel` and `invert` module
```
channel{channel:green},invert{}
```
The use of `()` in place of `{}` for backward compatibility with older links is now **deprecated**. (There is no longer support for the following syntax, and should be avoided)
```
channel(channel:green),invert()
```
Following are the core API functions that can be used to stringify and jsonify steps.
```js
sequencer.toString()//returns the stringified sequence of current steps
sequencer.toJSON(str)// returns the JSON for the current sequence
sequencer.stringToJSON(str)// returns the JSON for given stringified sequence
sequencer.importString(str)//Imports the sequence of steps into sequencer
sequencer.importJSON(obj)//Imports the given sequence of JSON steps into sequencer
```
Image Sequencer can also generate a string for usage in the CLI for the current sequence of steps:
```js
sequencer.toCliString()
```
## Importing steps using JSON array
Image sequencer provides the following core API function to import the given sequence of JSON steps into sequencer.
```js
sequencer.addSteps(module_name,optional_options);
sequencer.importJSON(obj)
```
All this can be passed in as JSON:
It can be implemented the following way for example:
where name is the name of step to be added, options object can be the one used to provide various params to the sequencer which can customise the default ones.
@@ -421,6 +500,10 @@ for a module. This can be used, for instance, to update the DIV with the new ima
and remove the loading GIF generated above.
* `onRemove` : This event is triggered when a module is removed. This can be used,
for instance, to remove the DIV generated above.
* `notify` : This event is triggered whenever we need to shoot a notification to the
user-interface.For example when the step is not available, we can shoot a notification,
by sending appropriate message.For HTML UI it adds a DOM node to the browser, for CLI
and node , it logs the notification output to the respective console.
How to define these functions:
@@ -429,7 +512,8 @@ sequencer.setUI({
onSetup:function(step){},
onDraw:function(step){},
onComplete:function(step){},
onRemove: function(step) {}
onRemove: function(step){},
notify:function(msg,id){}
});
```
@@ -472,10 +556,71 @@ sequencer.setUI({
});
```
Note: `identity.imageName` is the "name" of that particular image. This name can
be specified while loading the image via `sequencer.loadImage("name","SRC")`. If
not specified, the name of a loaded image defaults to a name like "image1",
"image2", et cetra.
## Using multiple images on same sequencer:
Details of all modules can be sought using `sequencer.modulesInfo()`.
Image Sequencer object supports one imageURL at a time.
Adding a seccond image to same sequencer will result to adding same set of steps added to prior image and flushing out the previous one.
```js
s1=newImageSequencer(...);
s1.loadImage(url1);
s1.addSteps('blur');
s1.run();
s1.addImage(url2);
s1.run();
```
However if we want to use more than one image, we can either initialize a sequencer for each image like:
```js
sequencer1=newImageSequencer(...);
sequencer1.loadImage(...);
sequencer1.addSteps(steps);
sequencer1.run();
sequencer2=newImageSequencer(...);
sequencer2.loadImage(...);
sequencer2.addSteps(steps);
sequencer2.run();
```
**Note**: Details of all modules can be sought using `sequencer.modulesInfo()`.
This method returns an object which defines the name and inputs of the modules. If a module name (hyphenated) is passed in the method, then only the details of that module are returned.
The `notify` function takes two parameters `msg` and `id`, former being the message to be displayed on console (in case of CLI and node ) and a HTML component(in browser). The id is optional and is useful for HTML interface to give appropriate IDs.
## Using WebAssembly for heavy pixel processing
Any module which uses the `changePixel` function gets WebAssembly acceleration (`wasm`). Both node and browser code use WebAssembly and the only code which falls back to non-`wasm` code is the [browserified unit tests](https://github.com/publiclab/image-sequencer/blob/main/test/core/sequencer/benchmark.js).
The main advantage we get using `wasm` is blazing fast speed attained in processing pixels for many modules that is very clear from [checking module benchmarks](https://travis-ci.org/publiclab/image-sequencer/jobs/544415673#L1931).
The only limitation is that browser and node code for `wasm` had to be written separately, and switched between. This is because in browser we use `fetch` to retrieve the compiled `wasm` program while in node we use the `fs` module, each of which cannot be used in the other's environment.
`wasm` mode is enabled by default. If you need to force this mode to be on or off, you can use the `useWasm` option when initializing ImageSequencer:
```js
letsequencer=ImageSequencer({useWasm:true})// for wasm mode or simply
letsequencer=ImageSequencer()// also for wasm mode i.e. default mode
ImageSequencer currently can process GIFs but only for most of the modules. Every frame of the GIF is manipulated sequentially (parallel processing would be preferable in the future).
The final frames are then converted back to a GIF but in the process, the time duration of each frame is lost and defaults to `0.1s`.
Modules that do not work:
1. ColorBar (Will get fixed upon fixing overlay as this is a meta module which uses overlay)
This module Adds QR corresponding to the given string.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('add-qr',options)
.run()
```
where `options` is an object with the following properties:
* size : size of QR code in pixels (default 200)
* qrCodeString : input string to generate QR code
## average-module
This module is used for averaging all the pixels of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('average',options)
.run()
```
## blend-module
This module is used for blending two images. For More info read: _[wiki](https://en.wikipedia.org/wiki/Blend_modes)_
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('blend',options)
.run()
```
where `options` is an object with the following properties:
* offset: step of image with which current image is to be blended(Two steps back is -2, three steps back is -3 etc; default -2)
* blendMode: Blending mode to use for blending two images by default it uses the given function
* func: function used to blend two images (default : function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] })
[More info for different blend modes can be found here](http://docs.gimp.org/en/gimp-concepts-layer-modes.html)
## Blob Analysis
This module uses Opencv.js for detecting and marking blob/region in microscopic images. It requires an opencv.js file to
be loaded before using the functionalities which is currently being loaded to the webpage via script.It supports both environments, Node.js and browser for processing.
As the size of opencv.js file is quite large, the future versions will focus on loading it asynchronously, on demand of the the module to optimise performance.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('blob-analysis')
.run()
```
## blur-module
This module is used for applying a Gaussian blur effect.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('blur',options)
.run()
```
where `options` is an object with the following property:
* blur : Intensity of Gaussian blur (0 to 5; default 2)
## brightness-module
This module is used for changing the brightness of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('brightness',options)
.run()
```
where `options` is an object with the following property:
* brightness : brightness of the image in percentage (0 to 100; default 100)
## canvas-resize-module
This module is used for resizing the canvas of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('canvas-resize',options)
.run()
```
where `options` is an object with the following property:
* width: final width of the canvas (default 1000)
* height: final height of the canvas (default 1000)
* x: x-coordinate of the top left of the image on the canvas (default 500)
* y: y-coordinate of the top left of the image on the canvas (default 500)
## channel-module
This module is used for forming a grayscale image by applying one of the three primary colors.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('channel',options)
.run()
```
where `options` is an object with the following property:
* channel : color of the channel (red, green, blue; default green)
## colorbar-module
This module is used for displaying an image with a colorbar.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('colorbar',options)
.run()
```
where `options` is an object with the following properties:
* colormap : Name of the Colormap(default, greyscale, stretched, fastie, brntogrn, blutoredjet, colors16; default: default)
* x : X-position of the image on which the new image is overlayed (default 0)
* y : Y-position of the image on which the new image is overlayed (default 0)
* h : height of resulting cropped image (default : 50% of input image width )
## colormap-module
This module is used for mapping brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('colormap',options)
.run()
```
where `options` is an object with the following property:
* colormap : Name of the Colormap ( greyscale, stretched, fastie, brntogrn, blutoredjet, colors16)
## Color Temperature
This changes the color temperature of the image.
## Usage
```js
sequencer.loadImage('PATH')
.addSteps('color-temperature',options)
.run()
```
where `options` is an object with the following property:
* temperature : temperature between 0 - 40,000 kelvin (default 6000)
## contrast-module
This module is used for changing the contrast of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('contrast',options)
.run()
```
where `options` is an object with the following property:
* contrast : contrast for the given image (-100 to 100; default : 70)
## convolution-module
This module is used for performing image-convolution.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('convolution',options)
.run()
```
where `options` is an object with the following properties:
* constantFactor : a constant factor, multiplies all the kernel values by that factor (default : 1/9)
* kernelValues : nine space separated numbers representing the kernel values in left to right and top to bottom format(default : 1 1 1 1 1 1 1 1 1)
## crop-module
This module is used to crop an image.
#### Usage
```js
@@ -24,10 +274,379 @@ Where `options` is an object having the properties `x`, `y`, `w`, `h`. This diag
*`options.h` : half of image height
## Segmented Colormap Module (segmented-colormap)
## decodeQr-module
This module is used for decoding a QR in image (if present).
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('decode-qr',options)
.run()
```
## dither-module
This module approximates a color from a mixture of other colors when the required color is not available, creating illusions of the color that is not present actually.
[more info on wikipedia](https://en.wikipedia.org/wiki/Dither)
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('dither',options)
.run()
```
where `options` is an object with the following property:
* dither : Can select the name of the Dithering Algorithm(default none)
## draw-rectangle-module
This module helps to draw a rectangle on the image with a starting and ending corner with the specified thickness and color of the border.
## Usage
```js
sequencer.loadImage('PATH')
.addSteps('draw-rectangle',options)
.run()
```
where `options` is an object with the following properties:
* startingX : starting x position of the rectangle (default 0)
* startingY : starting y position of the rectangle (default 0)
* endX : last x position of the rectangle (default "width")
* endY : last y position of the rectangle (default "height")
* thickness : thickness of the border (default 1)
* color : RGBA values separated by a space (default "0 0 0 255")
## dynamic-module
This module is used for producing each color channel based on the original image's color.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('dynamic',options)
.run()
```
where `options` is an object with the following properties:
* red : expression for red channel (R, G, B and A as inputs; default r)
* green : expression for green channel (R, G, B and A as inputs; default g)
* blue : expression for blue channel (R, G, B and A as inputs; default b)
* monochrome: fallback for other channels if none provided (default : r+g+b/3)
## edge-detect-module
This module is used for detecting images.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('edge-detect',options)
.run()
```
where `options` is an object with the following properties:
* blur : Intensity of Gaussian blur (0 to 5; default 2)
* highThresholdRatio : Upper Threshold Ratio ( default : 0.2)
* lowThresholdratio : Lower Threshold Ratio ( default : 0.2)
## exposure-module
This module is used for changing the exposure of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('exposure',options)
.run()
```
where `options` is an object with the following property:
* exposure: exposure value for the new image (-3 to 4; default 1)
## fisheyeGl-module
This module is used for correcting Fisheye or Lens Distortion
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('fisheye-gl',options)
.run()
```
where `options` is an object with the following properties:
* a : a correction (0 to 4; default 1)
* b : b correction (0 to 4; default 1)
* Fx : x correction (0 to 4; default 1)
* Fy : y correction (0 to 4; default 1)
* scale : The ratio to which the original image is to be scaled (0 to 20; default 1.5)
* x : Field of View x (0 to 2; default 1)
* y : Field of View y (0 to 2; default 1)
## flipimage-module
This module is used for flipping the image on the selected axis.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('flip-image',options)
.run()
```
where `options` is an object with the following properties:
* Axis : select the required axis (default : vertical)
## gamma-correction-module
This module is used for applying gamma correction.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('gamma-correction',options)
.run()
```
where `options` is an object with the following property:
* adjustment : Inverse of actual gamma factor (default 0.2)
## gradient-module
This module is used for finding gradient of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('gradient',options)
.run()
```
## Grid Overlay
This adds the grid over an image.
## Usage
```js
sequencer.loadImage('PATH')
.addSteps('grid-overlay',options)
.run()
```
where `options` is an object with the following property:
* options.x : The value at which the grid line should start in x-axis.
* options.y : The value at which the grid line should start in y-axis.
* color : Color for the grid on the image.
## histogram-module
This module is used for calculating histogram of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('histogram',options)
.run()
```
where `options` is an object with the following property:
* gradient : boolean value used to toggle gradient along x-axis (true or false; default true)
## import-image-module
This module is used for importing a new image and replacing the original with it.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('import-image',options)
.run()
```
where `options` is an object with the following property:
* url : url of the new image (local image url or data url;default : "./images/monarch.png")
## invert-module
This module is used for inverting the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('invert',options)
.run()
```
## Minify Image
This module minifies the image using lossy compression that is the image-dimensions are not lost but the size is reduced.
The module supports jpg/jpeg/webp images in browser; but the node version supports all of the types.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('minify-image')
.run()
```
## ndvi-module
This module is used for applying ndvi technique to the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('ndvi',options)
.run()
```
where `options` is an object with the following property:
* filter : filter for NDVI (blue or red; default red)
## ndvi-colormap-module
This module is used for demonstrating ndvi and colormap properties consecutively.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('ndvi-colormap',options)
.run()
```
## Noise-Reduction
Noise in an image are atypical pixels that are not representing the color or the exposure of the scene correctly. This Noise Reduction module reduces the noise in the image by using either median filtering or mean filtering techniques to change the RGB value of the pixels to create a smoother and fuller image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('noise-reduction',options)
.run()
```
where `options` is an object with the property `method`. `options.method` can be:
* Median Filtering: Set the RGB value of the pixel to the median RGB pixel value of all adjacent pixels (maximum 8 adjacent pixels and itself)
* Mean Filtering: Set the RGB value of the pixel to the mean RGB pixel value of all adjacent pixels (maximum 8 adjacent pixels and itself)
## overlay-module
This module is used for overlaying an Image over another .
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('overlay',options)
.run()
```
where `options` is an object with the following properties:
* x : X-position of the image on which the new image is overlayed (default 0)
* y : Y-position of the image on which the new image is overlayed (default 0)
* offset : offset to the step on which the output of the last step is overlayed (default -2)
## paint-bucket-module
This module fills any polygonal shape with the specified color in pixels.
## Usage
```js
sequencer.loadImage('PATH')
.addSteps('paint-bucket',options)
.run()
```
where `options` is an object with the following property:
* startingX : it is the value of the starting x-cordinate (default 10)
* startingY : it is the value of the starting y-cordinate (default 10)
* fillColor : they are four spaced seperated numbers representing the RGBA values of fill-color (default "100 100 100 255")
* tolerance : it is the % tolerance (default 10)
## replacecolor-module
This module is used in replacing the color with grey or any desired color.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('replace-color',options)
.run()
```
where `options` is an object with the following properties:
* replaceMethod : replaces with the desired color (default greyscale)
* replaceColor : three space separated numbers representing the RGB values of color to be filled (default "0 0 255")
* color : three space separated numbers representing the RGB values of color to be replaced (default "228 86 81")
* tolerance : it is the % tolerance (default 50)
## resize-module
This module is used for resizing an image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('resize',options)
.run()
```
where `options` is an object with the following property:
* resize : Percentage value of resize (default 125%)
## rotate-module
This module is used for rotating an image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('rotate',options)
.run()
```
where `options` is an object with the following property:
* rotate : angular value for rotation in degrees (between 0 and 360; default 0)
## saturation-module
This module is used for changing the saturation of the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('saturation',options)
.run()
```
where `options` is an object with the following property:
* saturation : saturation for the new image (between 0 and 2; default 0)
## segmented-colormap-module
This module is used to map the pixels of the image to a segmented colormap.
#### Usage
```js
@@ -48,23 +667,95 @@ where `options` is an object with the property `colormap`. `options.colormap` ca
* A custom array.
## FisheyeGl (fisheye-gl)
This module is used for correcting Fisheye or Lens Distortion
## sharpen-module
This module is used to sharpen the pixels of the image using a 3x3 convolution filter.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('fisheye-gl',options)
.addSteps('sharpen',options)
.run()
```
where `options` is an object with the following properties:
* a : a correction (0 to 4; default 1)
* b : b correction (0 to 4; default 1)
* Fx : x correction (0 to 4; default 1)
* Fy : y correction (0 to 4; default 1)
* scale : The ratio to which the original image is to be scaled (0 to 20; default 1.5)
* x : Field of View x (0 to 2; default 1)
* y : Field of View y (0 to 2; default 1)
where `options` is an object with the property `sharpenStrength`, which can be set to achieve the desired level of sharpening on the image.
## Text Overlay
The modules allows to add text to image in both browser and node environment. We have the options to modify the font-size and also support few font-styles. The text color can also be modified.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('grid-overlay',options)
.run()
```
The options can take various attributes like,
var options = { text : 'Hello World', size : '12'};
## Threshold
Thresholding is used to create binary images.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('threshold',options)
.run()
```
where `options` is an object with the following property:
* threshold : it allows to select the types of thresholding (default "manual thresholding")
* input : it allows to select the range of thresholding value (default 120)
## Tint
It adds color tint to an image
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('tint',options)
.run()
```
where `options` is an object with the following property:
* color : RGB values seperated by a space (default "0 0 255")
* factor : amount of tint (default 0.5)
## webgl-distort-module
This module is used for transforming the perspective of images based on corner coordinates.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('webgl-distort',options)
.run()
```
where `options` is an object with the following property:
* nw: top-left corner x and y coordinates separated by a comma (default "0,100")
* ne: top-right corner x and y coordinates separated by a comma (default "1023,-50")
* se: bottom-right corner x and y coordinates separated by a comma (default "1223,867")
* sw: bottom-left corner x and y coordinates separated by a comma (default "100,767")
## white-balance-module
This module is used for rendering neutral colors of an image correctly based on the whitest pixel in the image.
#### Usage
```js
sequencer.loadImage('PATH')
.addSteps('white-balance',options)
.run()
```
where `options` is an object with the following property:
* red: red component of the whitest pixel (default 255)
* green: green component of the whitest pixel (default 255)
* blue: blue component of the whitest pixel (default 255)
<!--Adding meta Tag for search engine optimisation-->
<metaproperty="og:description"
content="A pure JavaScript sequential image processing system, inspired by storyboards. Instead of modifying the original image, it creates a new image at each step in a sequence.">
content="Image Sequencer is an image editing tool that creates a new downloadble image at each step.It works in browser and supports both node and CLI.">
step.$step=scopeQuery.scopeSelector(step.ui);// Shorthand methods for scoped DOM queries. Read the docs [CONTRIBUTING.md](https://github.com/publiclab/image-sequencer/blob/main/CONTRIBUTING.md) for more info.
// Enable the load-image insert-step button when there are steps after load-image
// The logical operator is `> 0` because the number of steps is found before adding the step, actual logic is `steps.length + 1 > 1` which is later simplified.
// Enable the load-image insert-step button when there are steps after load-image
// The logical operator is `> 2` because the number of steps is found before removing the step, actual logic is `steps.length - 1 > 1` which is later simplified.
letpercentage=(80/height)*100;// Take the min resize value that fits the preview area => (new-width/orig_ht) - '80 as the preview area has 80*80 dimension.
percentage=Math.max((80/width)*100,percentage);// Make sure that one dimension doesn't resize greater, leading distorting preview-area fitting.
THIS SCRIPT IS NOT MEANT TO BE USED DIRECTLY, PLEASE NEWLY CLONE THE REPO IN A SEPARATE DIRECTORY AND USE THE SCRIPT THERE.
USING THIS SCRIPT IN YOUR MAIN CLONE MAY DELETE YOUR LOCAL CHANGES.
This script is made to be reusable: If you want to manually update the demo, \
use the interactive script \`update-demo\`. This script can also be used in a github action.
You can set the 4th argument to anything to bypass this warning. \
Setting the 4th argument means that the first 3 arguments are also set which means that you know what you are doing (I assume).
------IMPORTANT------
\033[0m"
echo -ne "Do you still want to continue? [Y/n]: "
read -e yN
case $yN in
[yY][eE][sS] | [yY])
;;
*)
exit 0
;;
esac
}
# --- Constants ---
deps="jquery bootstrap imgareaselect gifshot downloadjs selectize font-awesome bootstrap-colorpicker jspdf opencv.js/opencv.js" # A list of node_module dependencies to force commit
# --- Constants ---
# --- Arguments ---
# $1: Repo(to use as upstream) url in the form username/repo (default: publiclab/image-sequencer) NOTE: Github only
# $2: Branch to pull from eg: main or stable (default: stable)
# $3: CNAME URL (default: none)
# $4: Set the fourth argument to anything to bypass the warning.
if [[ "$1" != "" ]];
then
repo=$1
else
repo="publiclab/image-sequencer"
fi
if [[ "$2" != "" ]];
then
branch=$2
else
branch="stable"
fi
if [[ "$3" != "" ]];
then
CNAMEURL=$3
else
CNAMEURL=""
fi
# --- Arguments ---
# --- Main Script ---
if [[ "$4" == "" ]]; # Set a 4th argument to anything to bypass this warning.
then
warn
fi
git checkout gh-pages
git remote add upstream https://github.com/$repo
git fetch upstream
git reset --hard upstream/$branch
echo -e "Running setup script."
npm run setup
echo -e "Building dist files."
grunt production
if [ ! -f CNAME ];
then
echo -e "Creating CNAME"
touch CNAME
fi
echo $CNAMEURL > CNAME
echo -e "Removing unnecessary files."
rm -R docs/
rm -R test/
rm CONTRIBUTING.md
rm index.js
echo -e "Copying important files from src/"
cp src/ui/prepareDynamic.js prepareDynamic.js
echo "Removing src/"
rm -R src/
mkdir -p src/ui/
mv prepareDynamic.js src/ui/prepareDynamic.js
echo -e "git add dist and node_modules dependencies."
git add .
for dep in $deps; # Force add node_modules dependencies
* @description Loads an image via dataURL or normal URL. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
* @description Returns the current sequence of steps
* @returns {Object}
*/
functiongetSteps(){
returnthis.steps;
}
/**
* @method setUI
* @description To set up a UI for ImageSequencer via different callback methods. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
* @param {Object} UI Object containing UI callback methods. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
"description":"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2.",
"inputs":{
"offset":{
"type":"integer",
"desc":"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",
"default":-2
},
"blendMode":{
"type":"select",
"desc":"Name of the Blend Mode to use",
"default":"custom",
"values":[
"custom",
"Multiply",
"Divide",
"Overlay",
"Screen",
"Soft Light",
"Color Burn",
"Color Dodge",
"Grain Extract",
"Grain Merge"
]
},
"blend":{
"type":"string",
"desc":"Function to use to blend the two images.",
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.