Skip to content

Commit

Permalink
update installation page (#115)
Browse files Browse the repository at this point in the history
FileIO has changed to not install IO backends for users, hence we need to install Image IO backends manually. The new docs explain this to new beginners. It also introduces the brand new ImageIO backend.
  • Loading branch information
johnnychen94 authored Apr 2, 2020
1 parent 714107c commit 6c7ee22
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 49 deletions.
Binary file added docs/src/assets/installation/mandrill.tiff
Binary file not shown.
94 changes: 55 additions & 39 deletions docs/src/install.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,77 @@
# Getting started: Installation and testing your install
# Getting started

Most users probably want to start with the Images package, which bundles
Most users probably want to start with the `Images.jl` package, which bundles
much (but not all) of the functionality in JuliaImages.

## Installation

Install Images via the [package manager](https://docs.julialang.org/en/v1/stdlib/Pkg/),
Images (and possibly some additional packages) may be all you need to manipulate images programmatically.
You can install `Images.jl` via the [package manager](https://docs.julialang.org/en/v1/stdlib/Pkg/),

```julia
(v1.0) pkg> add Images
```

This will also install many dependencies.

Images (and possibly some additional packages) may be all you need to manipulate images programmatically.
However, most users will want to take one or two additional steps:
ensuring that you can load and display images.

!!! note
People in some regions such as China might fail to install/precompile `Images` due to poor network
status. Using proxy/VPN that has stable connection to Amazon S3 and Github can solve this issue.

## Loading your first image

When testing ideas or just following along with the documentation, it can be
useful to have some images to work with.
The [TestImages](https://github.com/JuliaImages/TestImages.jl) package bundles several "standard" images for you.
If you haven't already installed it, use `pkg> add TestImages`.

To load one of the images from this package, say
If this is your first time working with images in julia, it's likely that you'll need to install some
image IO backends to load the images. The current available backends for image files are:

* [ImageMagick.jl](https://github.com/JuliaIO/ImageMagick.jl) covers most image formats and has extra
functionality. This can be your first choice if you don't have a preference.
* [QuartzImageIO.jl](https://github.com/JuliaIO/QuartzImageIO.jl) exposes macOS's native image IO
functionality to Julia. In some cases it's faster than ImageMagick, but it might not cover all your
needs.
* [ImageIO.jl](https://github.com/JuliaIO/ImageIO.jl) is a new image IO backend (requires julia >=v"1.3")
that provides an optimized performance for PNG files. Check benchmark
[here](https://github.com/JuliaIO/PNGFiles.jl/issues/1)
* [OMETIFF.jl](https://github.com/tlnagy/OMETIFF.jl) supports
[OME-TIFF](https://docs.openmicroscopy.org/ome-model/6.0.0/index.html#ome-tiff) files. If you don't
know what it is, then it is likely that you don't need this package.

These backends aren't exclusive to each other, so if you're a macOS user, you can install all these
backends. And in most cases, you don't need to directly interact with these backends, instead, we
use the `save` and `load` provided by the [`FileIO.jl`](https://github.com/JuliaIO/FileIO.jl)
frontend. If you've installed multiple backends then `FileIO` will choose the most appropriate
backend acoording to your file format. For example, if available `ImageIO` is used to load PNG
files.

Adding these gives you a basic image IO setup:

```julia
using TestImages
img = testimage("mandrill")
(v1.0) pkg> add FileIO ImageMagick ImageIO
```

If this is your first time working with images in Julia, it's likely
that these commands will prompt you to install one or more additional
packages appropriate for your platform; you should generally accept
the recommendation, unless you have reasons to prefer an alternate
solution.
and to load an image, you can use

```@example
using FileIO
using ImageShow # hide
# specify the path to your local image file
img_path = "/path/to/image.png"
img_path = joinpath("assets", "installation", "mandrill.tiff") # hide
img = load(img_path)
```

For loading image files that might already be on your computer, you should
use the [FileIO
package](https://github.com/JuliaIO/FileIO.jl):
When testing ideas or just following along with the documentation, it can be useful to have some
images to work with. The [TestImages.jl](https://github.com/JuliaImages/TestImages.jl) package
bundles several "standard" images for you.

```julia
using FileIO
img = load("myphoto.png")
(v1.0) pkg> add TestImages
```

This should load the image for you, possibly prompting you to install
an input/output package appropriate for your platform.
To load one of the images from this package, say

```julia
using TestImages
# backends such as ImageMagick are required
img = testimage("mandrill")
```

## Displaying images

Expand All @@ -62,17 +82,13 @@ display automatically:

![IJulia](assets/ijulia.png)

Users of the Julia command-line interface (REPL) can install the [ImageView](https://github.com/timholy/ImageView.jl) package:

```julia
using TestImages, Images, ImageView
img = testimage("mandrill")
imshow(img)
```
Currently there're five julia packages can be used to display an image:

`ImageView` includes interactive features (panning/zooming, contrast
adjustment, playing movies, labeling, etc.) and may be of interest
even for users of graphical environments.
* [`ImageShow`](https://github.com/JuliaImages/ImageShow.jl) is used to support image display in Juno and IJulia. This happens automatically if you are `using Images`.
* [`ImageInTerminal`](https://github.com/JuliaImages/ImageInTerminal.jl) is used to support image display in terminal.
* [`ImageView`](https://github.com/JuliaImages/ImageView.jl) is an image display GUI. (For OSX and Windows platforms, Julia at least `v1.3` is required)
* [`Plots`](https://github.com/JuliaPlots/Plots.jl) maintained by JuliaPlots is a general plotting package that support image display.
* [`Makie`](https://github.com/JuliaPlots/Makie.jl) is also maintained by JuliaPlots but provides rich interactive functionality.

## Troubleshooting

Expand Down
10 changes: 0 additions & 10 deletions docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,6 @@ it straightforward to keep track of the correspondence between
location across multiple images. More information can be found in
[Keeping track of location with unconventional indices](@ref).

## Display

Currently there're five julia packages can be used to display an image:

* [`ImageShow`](https://github.com/JuliaImages/ImageShow.jl) is used to support image display in Juno and IJulia. This is automatically used when you use `Images`.
* [`ImageInTerminal`](https://github.com/JuliaImages/ImageInTerminal.jl) is used to support image display in terminal.
* [`ImageView`](https://github.com/JuliaImages/ImageView.jl) is an image display GUI. (For OSX and Windows platforms, Julia at least `v1.3` is required)
* [`Plots`](https://github.com/JuliaPlots/Plots.jl) maintained by JuliaPlots is a general plotting package that support image display.
* [`Makie`](https://github.com/JuliaPlots/Makie.jl) is also maintained by JuliaPlots but provides rich interactive functionality.

## Examples of usage

If you feel ready to get started, see the [Demonstrations](@ref) page for inspiration.
Expand Down

0 comments on commit 6c7ee22

Please sign in to comment.