Skip to content

Commit b0d7e5d

Browse files
lilithkornelski
authored andcommitted
Rewrite README.md
1 parent c8e979f commit b0d7e5d

File tree

1 file changed

+128
-98
lines changed

1 file changed

+128
-98
lines changed

README.md

Lines changed: 128 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
## ![imageflow](https://www.imageflow.io/images/imageflow.svg) optimal images at incredible speeds
22

3-
[![travis-master](https://img.shields.io/travis/imazen/imageflow/master.svg?label=master%3A%20mac64%20ubuntu64%2014.04%2016.04)](https://travis-ci.org/imazen/imageflow/builds) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/0356x95fa312m3wy/branch/master?svg=true&passingText=master%3A%20win32%20win64%20-%20passing&failingText=master%3A%20win32%20win64%20-%20failed)](https://ci.appveyor.com/project/imazen/imageflow/branch/master) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8403/badge.svg)](https://scan.coverity.com/projects/imazen-imageflow) [![state: technical preview](https://img.shields.io/badge/state-technical%E2%80%93preview-yellow.svg)](#flaws)
3+
[![travis-master](https://img.shields.io/travis/imazen/imageflow/master.svg?label=master%3A%20mac64%20ubuntu64%2014.04%2016.04)](https://travis-ci.org/imazen/imageflow/builds) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/0356x95fa312m3wy/branch/master?svg=true&passingText=master%3A%20win32%20win64%20-%20passing&failingText=master%3A%20win32%20win64%20-%20failed)](https://ci.appveyor.com/project/imazen/imageflow/branch/master) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8403/badge.svg)](https://scan.coverity.com/projects/imazen-imageflow) [![state: technical preview](https://img.shields.io/badge/state-release%E2%80%93candidate-yellow.svg)](#flaws)
44

5-
* **imageflow_server** can run jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from HTML. Source images can reside in blob storage, on another server, or on the filesystem.
6-
* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple [C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html) and [bindings](https://github.com/imazen/imageflow/tree/master/bindings).
7-
* **imageflow_tool** is a command-line tool for experimenting, running batch jobs, or when you want process isolation. Up to 17x faster than ImageMagick.
5+
[![Docker Pulls](https://img.shields.io/docker/pulls/imazen/imageflow_tool.svg)](https://hub.docker.com/r/imazen/imageflow_tool/)
6+
[![view releases](https://img.shields.io/badge/-download%20binaries%20for%20windows,%20mac,%20or%20linux-green.svg)](https://github.com/imazen/imageflow/releases)
87

9-
These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt) as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a self-contained binary for Windows and Mac. We offer Docker images for Linux (where glibc and OpenSSL are required).
108

11-
libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt). Unless you are using memory buffers for I/O, it's better to use `/build`.
9+
[Download](https://github.com/imazen/imageflow/releases) blazing fast and uniquely [safer](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=imagemagick) tools for a modern image workflow.
1210

13-
[![view releases](https://img.shields.io/badge/-view%20downloads%20and%20releases-green.svg)](https://github.com/imazen/imageflow/releases) or `docker run --rm imazen/imageflow_tool`
1411

15-
[We thank our backers on Kickstarter](https://www.kickstarter.com/projects/njones/imageflow-respect-the-pixels-a-secure-alt-to-image/posts/1616122) and [the many supporters of ImageResizer](https://imageresizing.net) for making this project a reality.
16-
Email support@imageflow.io if you need an AGPLv3 exception for commercial use.
12+
* **imageflow_tool** is a command-line tool for experimenting, running batch jobs,
13+
or when you want process isolation. Up to 17x faster than ImageMagick. Also produces smaller files at higher quality.
14+
* **imageflow_server** can run JSON jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from
15+
HTML. Source images can reside in blob storage, on another server, or on the filesystem.
16+
* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple
17+
[C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html)
18+
and [bindings](https://github.com/imazen/imageflow/tree/master/bindings).
19+
20+
**Note: We aren't labeling Imageflow as 'stable' until enough people have tested it. Please help us test and provide feedback!**
21+
Also, please, *please*, **please** [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98).
22+
1723

18-
Also, please [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98). We'd also appreciate it if you'd explore the JSON APIs and [review them and other topics where we are requesting feedback](https://github.com/imazen/imageflow/issues?q=is%3Aopen+is%3Aissue+label%3Arequesting-feedback). And – we need help with benchmarking on Windows.
24+
These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt)
25+
as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a
26+
[self-contained binary](https://github.com/imazen/imageflow/releases) for Windows, Ubuntu, and Mac. We also offer Docker images for Linux (where glibc and OpenSSL are required).
1927

20-
If we enough people beta-test Imageflow and provide feedback, we aim to publish a stable 1.0 release in August 2017 (along with Ruby and Node bindings). **See [flaws and missing features](#flaws) for project status.**
28+
libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt).
29+
Unless you are using memory buffers for I/O, it's better to use `/build`.
30+
31+
[We thank our backers on Kickstarter](https://www.kickstarter.com/projects/njones/imageflow-respect-the-pixels-a-secure-alt-to-image/posts/1616122)
32+
and [the many supporters of ImageResizer](https://imageresizing.net) for making this project a reality.
33+
Email support@imageflow.io if you need an AGPLv3 exception for commercial use.
2134

22-
## Using imageflow_tool
35+
36+
## Start with imageflow_tool (recommended)
2337

2438
`imageflow_tool examples --generate` - creates an *examples* directory with JSON jobs and invocation scripts.
2539

@@ -77,96 +91,146 @@ You'll want to mount various image source locations to prefixes. The `--mount` c
7791

7892
![](https://www.imageflow.io/images/imageflow-server-advanced.svg)
7993

80-
## Using libimageflow
94+
## Using libimageflow from your language
8195

8296
![](https://www.imageflow.io/images/libimageflow-direct.svg)
8397

84-
* C# - @samuelenglard has volunteered to create C# bindings for Imageflow. We're tracking [design here](https://github.com/imazen/imageflow/issues/67).
98+
* Preview C# bindings can be found at https://github.com/imazen/imageflow-dotnet
8599
* Ruby - Basic bindings can be found in [bindings/ruby/](https://github.com/imazen/imageflow/tree/master/bindings/ruby)
100+
* C and C++ interface is stable - use [bindings/headers/imageflow_default.h](https://github.com/imazen/imageflow/blob/master/bindings/headers/imageflow_default.h) or one of the many alternate conventions provided with each release.
101+
* Rust - Imageflow is written in Rust, so you can use the `imageflow_core` crate.
86102
* Node - Not yet started. Want to help? [generate bindings from the header files](https://github.com/tjfontaine/node-ffi-generate)
87-
* C and C++ - use [bindings/headers/imageflow_default.h](https://github.com/imazen/imageflow/blob/master/bindings/headers/imageflow_default.h) or one of the many alternate conventions provided with each release.
88-
* Rust - Imageflow is written in Rust. Use the `imageflow_core` crate, but be warned that this interface will evolve more rapidly than the FFI `imageflow` crate.
89103
* other languages - Use an [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) binding-generation tool for your language, and feed it whichever [header file it likes best](https://github.com/imazen/imageflow/tree/master/bindings/headers).
90104

91-
Official Ruby and Node bindings will be released by August 2017.
105+
You also may find that `imageflow_tool` is quite fast enough for your needs.
92106

107+
### Crates within this project
93108

94-
# How to build Imageflow from source
109+
* imageflow_abi - The stable API of libimageflow/imageflow.dll.
110+
Headers for libimageflow are located in `bindings/headers`
111+
* imageflow_tool - The command-line tool
112+
* imageflow_server - The HTTP server
113+
* c_components - A rust crate containing C source
114+
* c_components/tests - Tests for the C components
115+
* imageflow_types - Shared types used by most crates, with JSON serialization
116+
* imageflow_helpers - Common helper functions and utilities
117+
* imageflow_riapi - RIAPI and ImageResizer4 compatibility parsing/layout
118+
* imageflow_core - The main library and execution engine
95119

96-
We're assuming you've cloned already.
97120

98-
```bash
99-
git clone git@github.com:imazen/imageflow.git
100-
cd imageflow
101-
```
121+
### Known flaws and missing features (as of July 2017)
102122

103-
## Docker (linux/macOS/WinUbuntu)
123+
#### Flaws
104124

105-
This will create caches within `~/.docker_imageflow_caches` specific to the docker image used. Instances will be ephemeral; the only state will be in the caches.
125+
- [ ] imageflow_server doesn't expose the JSON API yet.
126+
- [ ] No fuzz testing or third-party auditing yet.
106127

107-
```bash
108-
./build_via_docker.sh debug
109-
```
128+
#### Missing features
110129

130+
- [ ] Animated GIF write support (reading individual frames is supported)
131+
- [ ] Some advanced rendering features: Whitespace detection/cropping, watermarking, blurring.
132+
- [ ] Automatic encoder selection and tuning.
111133

112-
## Linux (native)
134+
#### Delayed features
113135

114-
We need a few packages in order to build the C dependencies. You probably have most of these already.
136+
- [ ] Job cost prediction (delayed - no interest from community)
137+
- [ ] Node bindings (delayed - no interest from community)
115138

116-
* build-essential, nasm, pkg-config
117-
* wget, curl, git
118-
* libpng, libssl, ca-certificates
119139

120-
## For Ubuntu 14.04 and 16.04:
140+
# Building from Source without Docker
121141

122-
```bash
123-
sudo apt-get install --no-install-recommends \
124-
build-essential nasm pkg-config \
125-
wget curl git ca-certificates \
126-
libpng-dev libssl-dev
127-
```
142+
You'll need more than just Rust to compile Imageflow, as it has a couple C dependencies.
128143

129-
After installing the above, you'll need dssim, and Rust Nightly.
144+
1. **Install platform-specific prerequisites (find the right section below).**
145+
2. Run `cargo install dssim`
146+
3. Clone and cd into this repository
147+
E.g., `git clone git@github.com:imazen/imageflow.git && cd imageflow`)
130148

131-
```bash
132-
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2018-04-04
133-
./ci/nixtools/install_dssim.sh
134-
./build.sh
135-
```
149+
If you are using `bash` on any platform, you should be able to use `build.sh`
150+
* `./build.sh clean` - to clean
151+
* `./build.sh test` - run all tests
152+
* `./build.sh debug` - generate slow debug binaries
153+
* `./build.sh release` - generate release binaries
154+
* `./build.sh install` - install release binaries to `/usr/local` (must run `./build.sh release first)
155+
* `./build.sh uninstall` - uninstall release binaries
156+
157+
`build.sh` places binaries in the `./artifacts/ directory`
136158

137-
We aren't listing dependencies needed for
159+
If you are on Windows, only run build commands in the window created by `win_enter_env.bat`.
138160

161+
You can also build using `cargo` directly, although this will place binaries in `./target/release` instead.
162+
* `cargo test --all` to test Imageflow in debug (slooow) mode
163+
* `cargo build --package imageflow_abi --release` to compile `libimageflow/imageflow.dll`
164+
* `cargo build --package imageflow_tool --release` to compile `imageflow_tool(.exe)`
165+
* `cargo build --package imageflow_server --release` to compile `imageflow_server(.exe)`
166+
* `cargo build --all --release` to compile everything in release mode
167+
* `cargo doc --no-deps --all --release` to generate documentation.
168+
169+
170+
## Building from Source with Docker
171+
If you want to replicate the Imageflow CI environment:
172+
1. [Install Docker](https://docs.docker.com/install/)
173+
2. Run from a bash session (Windows WSL, macOS, or linux)
174+
3. ```bash
175+
git clone git@github.com:imazen/imageflow.git
176+
cd imageflow
177+
./build_via_docker.sh debug
178+
```
179+
180+
This will create caches within `~/.docker_imageflow_caches` specific to the docker image used. Instances will be ephemeral; the only state will be in the caches.
181+
182+
The [official Dockerfiles](https://github.com/imazen/dockerfiles_imageflow) are also a great place to get more detailed environment setup steps, as we don't list steps for setting up:
139183
* Valgrind (common versions break openssl; you may need to build from source)
140184
* Code coverage
141185
* Bindings.
142186

143-
Please consult the [official Dockerfiles](https://github.com/imazen/dockerfiles_imageflow) for these.
144-
145-
## OS X (native)
187+
## Linux Pre-requisites
146188

147-
You'll need a bit less on OS X, although this may not be comprehensive:
189+
(tested on Ubuntu 14.04, 16.04, and 18.04.)
148190

149191
```bash
150-
brew install nasm libpng pkg-config wget
151-
./ci/nixtools/install_dssim.sh
152-
./build.sh
192+
#Install Rust Nightly by running
193+
`curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2018-05-15`
194+
#Ensure build tools are installed (git, curl, wget, gcc, g++, nasm, pkg-config, openssl, ca-certificates)
195+
`sudo apt-get install git wget curl build-essential pkg-config libssl-dev libpng-dev nasm `
153196
```
154-
## Windows
155197

156-
### Pre-requisites
198+
## Mac OS Pre-requisites
199+
200+
1. Install [XCode Command-Line Tools](http://railsapps.github.io/xcode-command-line-tools.html) if you haven't already
201+
2. Install [Homebrew](https://brew.sh/) if you haven't already.
202+
3. Install nasm, pkg-config, and wget
203+
`brew install nasm pkg-config wget`
204+
4. Install [Rust](https://www.rust-lang.org/en-US/install.html)
157205

158-
1. Visual Studio 2015 or 2017 (Only the C++ Build Tools component is required)
159-
2. Install [Git 64-bit](https://git-scm.com/download/win).
160-
3. Install [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) Installer must be `Run as Administrator` - it will not prompt.
161-
4. Install [Rust 64-bit](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe). Install toolchain `nightly-2018-04-04` and set it as default. For the moment, 32-bit builds also require [a 32-bit Rust](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe).
162206

163-
You need all of these to be in %PATH%. Edit `ci/wintools/SETUP_PATH.bat` as appropriate to ensure that rust/cargo, nasm, git, and Git/mingw64/bin are all available.
207+
## Windows WSL (Ubuntu Bionic Subsystem) Pre-requisites
164208

165-
1. Run `win_enter_env.bat` to start a sub-shell with VS tools loaded and a proper PATH. Edit the file per its comments to target a 32-bit build (you may want a separate imageflow folder for each target).
166-
4. `cd ..\..` back to the root and run `win_build_c.bat` again.
167-
5. Run `win_build_rust.bat` to compile the Rust components
209+
1. Install [Ubuntu 18.04 from the Windows Store](https://www.microsoft.com/store/productId/9N9TNGVNDL3Q)
210+
2. Run Ubuntu 18.04 and create your username/password
211+
3. `sudo apt-get update` to update available packages.
212+
4. Install Rust Nightly by running
213+
`curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2018-05-15`
214+
5. Ensure build tools are installed (git, curl, wget, gcc, g++, nasm, pkg-config, openssl, ca-certificates)
215+
`sudo apt-get install git wget curl build-essential pkg-config libssl-dev libpng-dev nasm `
216+
6. (optional) To use a graphical text editor, you'll need to download imageflow to a "Windows" directory, then map it to a location in Ubuntu.
217+
For example, if you cloned imageflow to Documents/imageflow, you would run:
218+
`ln -s /mnt/c/Users/[YourWindowsUserName]/Documents/imageflow ~/win_imageflow`
219+
7. Close and re-open Ubuntu
168220

169221

222+
## Windows 10 Pre-requisites
223+
224+
1. Install Visual Studio 2017 Build Tools ([separately](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15) or as a VS component)
225+
2. Install [Git 64-bit](https://git-scm.com/download/win).
226+
3. `Run As Administrator` the [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) installer - it will not prompt.
227+
4. Install [Rust 64-bit](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe) if you want 64-bit Imageflow or [Rust 32-bit](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe) if you don't.
228+
Install toolchain `nightly-2018-05-15` as the default, and confirm adding it to `PATH`.
229+
5. Open the command line and switch to this repository's root directory
230+
5. Edit `ci/wintools/SETUP_PATH.bat` to ensure that rust/cargo, nasm, git, and Git/mingw64/bin are all in `%PATH%`.
231+
7. Run `win_enter_env.bat` to start a sub-shell (edit it if you want a 32-bit build)
232+
8. All build commands should be run in the sub-shell. Run `cmd.exe /c "ci\wintools\win_verify_tools.bat"` to check tools are present.
233+
170234
## How does one learn image processing for the web?
171235

172236
First, [read High Performance Images](http://shop.oreilly.com/product/0636920039730.do) for context.
@@ -184,37 +248,3 @@ I would start by reading [Principles of Digital Image Processing: Core Algorithm
184248
I have found the source code for OpenCV, LibGD, FreeImage, Libvips, Pixman, Cairo, ImageMagick, stb_image, Skia, and FrameWave is very useful for understanding real-world implementations and considerations. Most textbooks assume an infinite plane, ignore off-by-one errors, floating-point limitations, color space accuracy, and operational symmetry within a bounded region. I cannot recommend any textbook as an accurate reference, only as a conceptual starting point. [I made some notes regarding issues to be aware of when creating an imaging library](https://github.com/imazen/Graphics-vNext/blob/master/aware.md).
185249

186250
Also, keep in mind that computer vision is very different from image creation. In computer vision, resampling accuracy matters very little, for example. But in image creation, you are serving images to photographers, people with far keener visual perception than the average developer. The images produced will be rendered side-by-side with other CSS and images, and the least significant bit of inaccuracy is quite visible. You are competing with Lightroom; with offline tools that produce visually perfect results. End-user software will be discarded if photographers feel it is corrupting their work.
187-
188-
### Source organization
189-
190-
Rust crates
191-
192-
* imageflow_types - Shared types, with JSON serialization
193-
* imageflow_helpers - Common helper functions and utilities
194-
* imageflow_riapi - RIAPI and ImageResizer4 compatibility parsing/layout
195-
* imageflow_core - The main library
196-
* imageflow_abi - The C-Compatible API - exposes functionality from imageflow_core
197-
* imageflow_tool
198-
* imageflow_server
199-
200-
C source is located in ./c_components/lib, and ./c_components/tests
201-
202-
Headers for libimageflow.dll are located in `bindings/headers`
203-
204-
### Known flaws and missing features (as of July 2017)
205-
206-
#### Flaws
207-
208-
- [ ] imageflow_server doesn't expose the JSON API yet.
209-
- [ ] No fuzz testing or third-party auditing yet.
210-
211-
#### Missing features
212-
213-
- [ ] Animated GIF write support (reading individual frames is supported)
214-
- [ ] Some advanced rendering features: Whitespace detection/cropping, watermarking, blurring.
215-
- [ ] Automatic encoder selection and tuning.
216-
217-
#### Delayed features
218-
219-
- [ ] Job cost prediction (delayed - no interest from community)
220-
- [ ] Node bindings (delayed - no interest from community)

0 commit comments

Comments
 (0)