TestImages.jl
A repository of standard test images for Images.jl
Installation
On Linux and OSX, this should install automatically. If you find yourself missing most of the images described below, please try Pkg.build("TestImages")
, which should trigger another attempt to download the standard images.
In case you would like to download other images from the repository not in the standard set, you can call the testimage
with the image name and it will be downloaded from the repository.
On Windows, the download
command, used to download images from the archives, is not fully supported. You can manually download the files listed in deps\build.jl
from the images
folder of the gh-pages
branch of this repository and place them in TestImages\images
.
Usage
using TestImages
img = testimage("cameraman")
The standard test images are downloaded to an images/
directory inside this package. Any image file stored in this directory is accessible through the testimage
function. You can supply the file extension (e.g., ".png", ".tif", etc), but it is not required.
In case the image is not present locally, the testimage
function will check the online repository and download it for you.
Contributing
Anyone can contribute images to this repository by submitting a pull request at the github repo. Do check the images for copyright or license issues before submitting.
The following steps should be followed to add an image/imageset to the repository :
-
Do
git checkout -b gh-pages
in your local repository folder. Pkg.dir("TestImages")
gives the location of the repo.
-
Add the image locally to the
images/
folder on your machine.
-
Run
build.jl
: Do julia build.jl
to generate the javascript file for the documentation. This will also generate a thumbnails
folder.
-
Do
git add --all
to stage the changes for a commit.
-
git commit -m "Adds <filename> to the repository from link <link>"
-
git push fork gh-pages
-
Now submit a pull request to the
gh-pages
branch. Once accepted, the image or imageset will be stored at
https://github.com/juliaimages/TestImages.jl/blob/gh-pages/images/<filename>.
Now that the images are added to the repository, we need to modify the source files of the TestImages.jl package to make them available for download.
-
Do
git checkout master
to return to the master branch.
-
<<<<<<< Updated upstream
Modify
src/TestImages.jl
: Add an entry with the filename to the remotedict
dictionary.
=======
Modify deps/build.jl
: Add a (key, value)=(imagename, link) pair to the remotedict
dictionary. For example, to add an image with the name "helloworld", add it to the repository as shown above and then add the entry "helloworld" => "https://github.com/juliaimages/TestImages.jl/blob/gh-pages/images/helloworld.jpg"
to the dictionary.
>>>>>>> Stashed changes
-
Do
git add --all
to add the changed source files.
-
git commit -m "Adds <filename> to package"
-
git push fork master
-
Now submit a pull request to the
master
branch. Once accepted, the image or imageset will be available for download to users of TestImages.jl.
The Images [ Click Name to Download ]