Skip to content

Commit 6c7ee22

Browse files
authored
update installation page (#115)
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.
1 parent 714107c commit 6c7ee22

File tree

3 files changed

+55
-49
lines changed

3 files changed

+55
-49
lines changed
768 KB
Binary file not shown.

docs/src/install.md

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,77 @@
1-
# Getting started: Installation and testing your install
1+
# Getting started
22

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

66
## Installation
77

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

1011
```julia
1112
(v1.0) pkg> add Images
1213
```
1314

14-
This will also install many dependencies.
15-
16-
Images (and possibly some additional packages) may be all you need to manipulate images programmatically.
17-
However, most users will want to take one or two additional steps:
18-
ensuring that you can load and display images.
19-
2015
!!! note
2116
People in some regions such as China might fail to install/precompile `Images` due to poor network
2217
status. Using proxy/VPN that has stable connection to Amazon S3 and Github can solve this issue.
2318

2419
## Loading your first image
2520

26-
When testing ideas or just following along with the documentation, it can be
27-
useful to have some images to work with.
28-
The [TestImages](https://github.com/JuliaImages/TestImages.jl) package bundles several "standard" images for you.
29-
If you haven't already installed it, use `pkg> add TestImages`.
30-
31-
To load one of the images from this package, say
21+
If this is your first time working with images in julia, it's likely that you'll need to install some
22+
image IO backends to load the images. The current available backends for image files are:
23+
24+
* [ImageMagick.jl](https://github.com/JuliaIO/ImageMagick.jl) covers most image formats and has extra
25+
functionality. This can be your first choice if you don't have a preference.
26+
* [QuartzImageIO.jl](https://github.com/JuliaIO/QuartzImageIO.jl) exposes macOS's native image IO
27+
functionality to Julia. In some cases it's faster than ImageMagick, but it might not cover all your
28+
needs.
29+
* [ImageIO.jl](https://github.com/JuliaIO/ImageIO.jl) is a new image IO backend (requires julia >=v"1.3")
30+
that provides an optimized performance for PNG files. Check benchmark
31+
[here](https://github.com/JuliaIO/PNGFiles.jl/issues/1)
32+
* [OMETIFF.jl](https://github.com/tlnagy/OMETIFF.jl) supports
33+
[OME-TIFF](https://docs.openmicroscopy.org/ome-model/6.0.0/index.html#ome-tiff) files. If you don't
34+
know what it is, then it is likely that you don't need this package.
35+
36+
These backends aren't exclusive to each other, so if you're a macOS user, you can install all these
37+
backends. And in most cases, you don't need to directly interact with these backends, instead, we
38+
use the `save` and `load` provided by the [`FileIO.jl`](https://github.com/JuliaIO/FileIO.jl)
39+
frontend. If you've installed multiple backends then `FileIO` will choose the most appropriate
40+
backend acoording to your file format. For example, if available `ImageIO` is used to load PNG
41+
files.
42+
43+
Adding these gives you a basic image IO setup:
3244

3345
```julia
34-
using TestImages
35-
img = testimage("mandrill")
46+
(v1.0) pkg> add FileIO ImageMagick ImageIO
3647
```
3748

38-
If this is your first time working with images in Julia, it's likely
39-
that these commands will prompt you to install one or more additional
40-
packages appropriate for your platform; you should generally accept
41-
the recommendation, unless you have reasons to prefer an alternate
42-
solution.
49+
and to load an image, you can use
50+
51+
```@example
52+
using FileIO
53+
using ImageShow # hide
54+
# specify the path to your local image file
55+
img_path = "/path/to/image.png"
56+
img_path = joinpath("assets", "installation", "mandrill.tiff") # hide
57+
img = load(img_path)
58+
```
4359

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

4864
```julia
49-
using FileIO
50-
img = load("myphoto.png")
65+
(v1.0) pkg> add TestImages
5166
```
5267

53-
This should load the image for you, possibly prompting you to install
54-
an input/output package appropriate for your platform.
68+
To load one of the images from this package, say
69+
70+
```julia
71+
using TestImages
72+
# backends such as ImageMagick are required
73+
img = testimage("mandrill")
74+
```
5575

5676
## Displaying images
5777

@@ -62,17 +82,13 @@ display automatically:
6282

6383
![IJulia](assets/ijulia.png)
6484

65-
Users of the Julia command-line interface (REPL) can install the [ImageView](https://github.com/timholy/ImageView.jl) package:
66-
67-
```julia
68-
using TestImages, Images, ImageView
69-
img = testimage("mandrill")
70-
imshow(img)
71-
```
85+
Currently there're five julia packages can be used to display an image:
7286

73-
`ImageView` includes interactive features (panning/zooming, contrast
74-
adjustment, playing movies, labeling, etc.) and may be of interest
75-
even for users of graphical environments.
87+
* [`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`.
88+
* [`ImageInTerminal`](https://github.com/JuliaImages/ImageInTerminal.jl) is used to support image display in terminal.
89+
* [`ImageView`](https://github.com/JuliaImages/ImageView.jl) is an image display GUI. (For OSX and Windows platforms, Julia at least `v1.3` is required)
90+
* [`Plots`](https://github.com/JuliaPlots/Plots.jl) maintained by JuliaPlots is a general plotting package that support image display.
91+
* [`Makie`](https://github.com/JuliaPlots/Makie.jl) is also maintained by JuliaPlots but provides rich interactive functionality.
7692

7793
## Troubleshooting
7894

docs/src/quickstart.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,6 @@ it straightforward to keep track of the correspondence between
301301
location across multiple images. More information can be found in
302302
[Keeping track of location with unconventional indices](@ref).
303303

304-
## Display
305-
306-
Currently there're five julia packages can be used to display an image:
307-
308-
* [`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`.
309-
* [`ImageInTerminal`](https://github.com/JuliaImages/ImageInTerminal.jl) is used to support image display in terminal.
310-
* [`ImageView`](https://github.com/JuliaImages/ImageView.jl) is an image display GUI. (For OSX and Windows platforms, Julia at least `v1.3` is required)
311-
* [`Plots`](https://github.com/JuliaPlots/Plots.jl) maintained by JuliaPlots is a general plotting package that support image display.
312-
* [`Makie`](https://github.com/JuliaPlots/Makie.jl) is also maintained by JuliaPlots but provides rich interactive functionality.
313-
314304
## Examples of usage
315305

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

0 commit comments

Comments
 (0)