Skip to content

Commit

Permalink
Merge pull request #1 from publiclab/main
Browse files Browse the repository at this point in the history
added new commits
  • Loading branch information
MargaretAN9 authored Jan 3, 2019
2 parents 948f67f + 39c70d1 commit 1d6fd81
Show file tree
Hide file tree
Showing 54 changed files with 12,382 additions and 11,210 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Most contribution (we imagine) would be in the form of API-compatible modules, w
* [README.md](https://github.com/publiclab/image-sequencer)
* [Contributing Modules](#contributing-modules)
* [Info File](#info-file)
* [Ideas](#ideas)
* [Ideas](#Contribution-ideas)

****

## Contribution ideas
## Contribution-ideas

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

Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Image Sequencer is different from other image processing systems in that it's _n
* 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
* works identically in the browser, on Node.js, and on the command line

![workflow diagram](https://raw.githubusercontent.com/publiclab/image-sequencer/master/examples/images/diagram-workflows.png)

It is also for prototyping some other related ideas:

* 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](https://publiclab.org/notes/warren/05-10-2018/prototype-filter-map-tiles-in-real-time-in-a-browser-with-imagesequencer-ndvi-landsat)
* filter-like image processing -- applying 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 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
* cascading changes -- change an earlier step's settings, and see those changes affect later steps
Expand Down Expand Up @@ -45,17 +45,17 @@ A diagram of this running 5 steps on a single sample image may help explain how

## Installation

This library works in the browser, in Node, and on the commandline (CLI), which we think is great.
This library works in the browser, in Node, and on the command line (CLI), which we think is great.

### Unix based platforms
You can setup a local environement to test the UI with `sudo npm setup` followed by `npm start`
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.
Our npm scripts do not support windows shells, please run the following snippet in PowerShell.
```powershell
npm i ; npm i -g grunt grunt-cli ; grunt serve
```
In case of a port conflict please run the folowing
In case of a port conflict please run the following
```powershell
npm i -g http-server ; http-server -p 3000
```
Expand All @@ -67,7 +67,7 @@ Just include [image-sequencer.js](https://publiclab.github.io/image-sequencer/di
### 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`

### CLI

Expand All @@ -93,13 +93,13 @@ Image Sequencer can be used to run modules on an HTML Image Element using the
modified. `steps` may be the name of a module or array of names of modules.

Note: Browser CORS Restrictions apply. Some browsers may not allow local images
form other folders, and throw a Security Error instead.
from other folders, and throw a Security Error instead.

```js
sequencer.replaceImage(selector,steps,optional_options);
```

`optional_options` allows to pass additional arguments to the module itself.
`optional_options` allows passing additional arguments to the module itself.

For example:

Expand Down Expand Up @@ -144,7 +144,7 @@ The CLI also can take multiple steps at once, like so:

But for this, double quotes must wrap the space-separated steps.

Options for the steps can be passed in one line as json in the details option like
Options for the steps can be passed in one line as JSON in the details option like
```
$ ./index.js -i [PATH] -s "brightness" -c '{"brightness":50}'
Expand All @@ -158,7 +158,7 @@ Or the values can be given through terminal prompt like
sequencer --save-sequence "invert-colormap invert(),colormap()"
```

`install-module` option can be used to install new modules from npm. You can register this module in your sequencer with a custom name space sepated with the npm package name. Below is an example for the `image-sequencer-invert` module.
`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.
```shell
sequencer --install-module "invert image-sequencer-invert"
```
Expand Down Expand Up @@ -196,7 +196,7 @@ CORS Restrictions). To sum up, these are accepted:
* DataURLs

return value: **none** (A callback should be used to ensure the image gets loaded)
The callback is called within the scope of a the sequencer. For example:
The callback is called within the scope of a sequencer. For example:
(addSteps is defined later)

```js
Expand All @@ -210,7 +210,7 @@ In this case, only `'SRC'`.

### Adding steps to the image

The `addSteps` method is used to add steps on the image. One or more steps can
The `addSteps` method is used to add steps to the image. One or more steps can
be added at a time. Each step is called a module.

```js
Expand Down Expand Up @@ -239,7 +239,7 @@ sequencer.run();
Sequencer can be run with a custom config object

```js
// The config object enables custom progress bars in node environment and
// The config object enables custom progress bars in a node environment and
// ability to run the sequencer from a particular index(of the steps array)

sequencer.run(config);
Expand All @@ -263,7 +263,7 @@ sequencer.run(function callback(out){
// "out" is the DataURL of the final image.
});
sequencer.run(config,function callback(out){
// the callback is supported with all types of invocations
// the callback is supported by all types of invocations
});
```

Expand All @@ -273,7 +273,7 @@ return value: **`sequencer`** (To allow method chaining)
### Removing a step from the sequencer

The `removeSteps` method is used to remove unwanted steps from the sequencer.
It accepts the index of the step as an input, or an array of the unwanted indices
It accepts the index of the step as an input or an array of the unwanted indices
if there are more than one.

For example, if the modules ['ndvi-red','crop','invert'] were added in this order,
Expand All @@ -293,7 +293,7 @@ return value: **`sequencer`** (To allow method chaining)
### Inserting a step in between the sequencer

The `insertSteps` method can be used to insert one or more steps at a given index
in the sequencer. It accepts the index where the module is to be inserted, name of
in the sequencer. It accepts the index where the module is to be inserted, the name of
the module, and an optional options parameter. `index` is the index of the inserted
step. Only one step can be inserted at a time. `optional_options` plays the same
role it played in `addSteps`.
Expand All @@ -311,7 +311,7 @@ return value: **`sequencer`** (To allow method chaining)

### Importing an independent module

The `loadNewModule` method can be used to import a new module inside 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.
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
const module = require('sequencer-moduleName')
Expand All @@ -327,7 +327,7 @@ Methods can be chained on the Image Sequencer:
* 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.
be of the form "image<number>". For Ex: "image1", "image2", "image3", etc.

Valid Chains:
```js
Expand Down Expand Up @@ -384,7 +384,7 @@ return value: **none**
### Adding Steps on Multiple Images

The same method `addSteps` is used for this. There's just a slight obvious change
in the syntax that the image name has to be supplied too. `image_name` as well as
in the syntax that the image name has to be supplied too. `image_name` as well as,
`module_name` in the following examples can be either strings or arrays of strings.
```js
Expand Down Expand Up @@ -435,7 +435,7 @@ The `run` method also accepts an optional callback just like before:
});
```
JSON Input is also acceptable.
JSON input is also acceptable.
```js
sequencer.run({
Expand Down Expand Up @@ -474,7 +474,7 @@ return value: **`sequencer`** (To allow method chaining)
### Inserting steps on an image
The `insertSteps` method can also accept an `image_name` parameter. `image_name`
may be an array. Everything else remains the same. JSON Inout is acceptable too.
may be an array. Everything else remains the same. JSON Input is acceptable too.
```js
sequencer.insertSteps("image",index,"module_name",o);
Expand All @@ -495,7 +495,7 @@ return value: **`sequencer`** (To allow method chaining)
## 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 inside the browser and inside a json file in node.js. sequences can be saved in node context using the CLI option
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 inside 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"
Expand All @@ -516,7 +516,7 @@ Image sequencer supports stringifying a sequence which is appended to the url an
channel{channel:green},invert{}
```
Sequencer also supports use of `()` in place of `{}` for backwards compatibility with older links.(This syntax is deprecated and should be avoided as far as possible)
Sequencer also supports the use of `()` in place of `{}` for backward compatibility with older links. (This syntax is deprecated and should be avoided as far as possible)
```
channel(channel:green),invert()
```
Expand Down
Loading

0 comments on commit 1d6fd81

Please sign in to comment.