What image formats do you use within Julia?

Hello all!

I often use SVG images without using Cairo.jl or Luxor.jl. I am probably in the “minority”. For raster images, I tend to use PNG.

So, what image formats do you use within Julia?

While the question does not provide academically meaningful statistics, it may help package developers determine what formats they need to focus their support on.

When replying, please mention one specific format to avoid duplication.
(Edit: If you use more than one format, I want you to write multiple reply. Even though there are differences in application, you may express your agreement by pressing the LIKE🩷 button.)
Particularization (e.g., “PNG with alpha channel”) is fine, but please do not generalize (e.g., “I love both JPEG and PNG!”).

Background

This is not to say that this is anyone’s fault, but ImageMagick has always been a troublemaker.
We already have separate packages for commonly used formats such as JPEG or PNG. We also have a collection of those packages, ImageIO.jl.
I’m curious to know who in the end-user base specifically relies on ImageMagick.
This would make an opportunity to create separate packages for the specific formats (or the specific applications).

The new package will be more compatible with the JuliaImages ecosystem (especially regarding the column-/row-major issue).
For the maintainers in JuliaImages, that has the advantage of making it harder to get into trouble with ImageMagick.
The fattening of ImageIO might cause the same kind of trouble with ImageMagick, but it should be more controllable for us.

Also, ColorTypes.jl, which is upstream of the JuliaImages ecosystem, only supports commonly used pixel formats.
Currently, support for bit-packing and heterogeneous types (e.g. (c1::UInt16, c2::Int8, c3::Int8)) is limited.
In short, there is also room for improvement in the upstream.


In any case, since this topic is in the Community category, not everyone needs to know about the technical issues.
Let’s talk about your favorites or creative challenges!

4 Likes

SVG

I use it mainly for Plots.jl output (with default GR backend).

(This is an example of answer, and my real answer.)

7 Likes

PDF

I mainly use PDF outputs created by plotting packages (such as Plots.jl or PyPlot.jl).

15 Likes

PNG

I use PNG to load files from the Internet and to save the results of image processing. The advantages are the lossless compression and the ability to handle alpha channels.
I am very grateful to PNGFiles.jl.

Multiple (i.e., separate) replies are welcome in this topic. I also use other image formats, but I hope others will raise them.

11 Likes

JPEG

Since my phone camera exports JPEGs, and I have a couple tools for image things with JPEG. I have also run into some (minor) issues being able to easily extract the EXIF data, so simpler way to do that would be awesome! (edit: see below!)

(may I also suggest users give hearts for the formats they use?)

3 Likes

For the reference of everyone reading this topic, we have the Libexif wrapper, ExifViewer.jl.

Anything that can make this topic more active is welcome.
(If it gets out of control, it will just be locked at that point.:grin:)

1 Like

Oh, great tip on ExifViewer.jl! My issues were in the past before this package was registered, so its nice to see this!

TIFF

https://discourse.julialang.org/search?q=tiff%20in%3Atitle
It features multi-page and floating-point supports. (Conversely, they require some care in handling.)

1 Like

GIF

https://discourse.julialang.org/search?q=gif%20in%3Atitle

The most important feature of GIF is animation.
Although various web services and media nowadays support video files, there are still many situations where GIFs are useful.

We now have a separate package, GIFImages.jl.

4 Likes

WebP

https://discourse.julialang.org/search?q=%22webp%20%22%20in%3Atitle
There have been ways to handle WebP in Julia for a while. Last month WebP.jl was launched!

1 Like

Of course it depends on what I’m using the graphics for: Microsoft Office, for instance, does not accept PDF (or any vector graphics, from my understanding), so exporting all my graphics as PDF is a great way to make sure I never have to collaborate with someone in Microsoft Office.

2 Likes

Recent versions of Microsoft Office support SVG, although that is not perfect.
Of course, the traditional WMF and EMF are still supported.
(Also, Microsoft Word “partially” supports PDF import, although I don’t think that is practical.)

Perhaps you are joking, but there should be a distinction between choosing the appropriate format for a purpose and being exclusive.
My aim behind this topic is to help the Julia ecosystems provide inclusive supports to the extent practicable.

1 Like

Microsoft Edge opens PDF files without problem.
Microsoft Word opens the PDF and converts it to an editable Word file.
And then there are many free viewers and editors in Windows.
No junk, no excuses.

I mean specifically as an image format.
You cannot import a PDF graphic into a Word document or PowerPoint presentation.

SVG is an annoying choice since that’s the one format that works worst in LaTeX, but I guess it’s nice there’s a working format now.

Vector graphics for figures I generate (PDF, SVG, PS).
JPG for web related camera images.
I sometimes will use TIFF for microscopy images.
All other cases I’ll use PNG.

But I’m also excited about HEIF and WebP…!

(cherry-picking)

PS

In the modern LaTeX environment, it is the practice to use PDF when working with PostScript-based figures.
However, PS files have the advantage that they are text files, making it easier to edit margins, etc.

(cherry-picking)

HEIF / HEIC

Strictly speaking, HEIF is a container format, but it effectively refers to images encoded in H.265/HEVC (as HEIC).

At this point, it seems somewhat difficult to handle HEIF in Julia.
ImageMagick.jl supports HEIF, but fails to load some image files.
VideoIO.jl does not appear to support HEIF. Perhaps we need to do some low level command processing with FFMPEG.jl.
Also, be aware of patent issues regarding the use of HEVC. A similar format that is royalty-free is AVIF.

Please provide information.