- Command line SVG and image file viewer in Linux?
- 10 Answers 10
- How Do I View A PNG File in Linux
- What is a PNG file?
- Advantages of PNG
- Disadvantages of PNG
- How to Open A PNG file in Linux
- gThumb
- Shotwell
- Feh
- Nomacs
- Conclusion
- About the author
- John Otieno
- Просмотрщики
- Koko
- Viewnior
- qView
- Eye Of Gnome
- Nomacs
- Gwenview
- Ristretto
- XnViewMP
- Geeqie
- PhotoQt
- GPicView
Command line SVG and image file viewer in Linux?
Is there any command line (pipeable) graph viewer for SVG, JPG, and PNG images? I’m particularly looking for a way to pipe the graphs/images to the program, instead of using files, so there must be an option to specify the file type/extension. Though gv works for PS/PDF generated by dot programs, I’d like to know whether there are alternatives for supporting SVG image files.
just to clarify: your main point is not to display the .svg, .jpg and .png on the console («command line»), but rather to pipe such mime-types to a normal graphical program?
eye-of-gnome (eog) shows svg files. Your browser (e.g. chromium) can also show svg files. I mostly do chromium *.svg to view my SVGs
10 Answers 10
Have you tried the display program that comes with ImageMagick?
AFAIK, Imagemagick alone can’t display SVG files, it needs a tool that converts SVG to bitmap. On Debian, sudo aptitude install librsvg2-bin is necessary if «rsvg-convert» isn’t installed yet. The package also contains a viewer rsvg-view-3 that has better zoom than display .
@Mytskine: According to the ImageMagick Documentation, it will use its own internal SVG renderer if Inkscape or RSVG aren’t available.
On my system: inkscape is slow to load, inkview is fast but cannot seem to change view? display works great for me 🙂
WARNING. do not use display if you are in a hurry. for a 500kb svg file (of analyzing systemd boot problems), it took 20min before I could use my machine again, as it used 4GB (requested 7GB of virt.mem) of my 6GB already bloated RAM and was swapping a huge lot (5GB went to swap only because of display) :(, not sure about performance of any other option to visualize svg tho., gwenview quite fast btw
@HughPerkins: For me (Arch Linux), inkview can zoom by just changing the size of the window, and change to the next image by space bar/ arrow keys.
Inkscape already comes with its own viewer: inkview
It lacks features, it might be a bit slow, but it works (and probably renders SVG more accurately than ImageMagick’s display ).
Just wanted to note that I tried inkview (I believe from 0.48 inkscape) on Ubuntu 10.04.3, started up amazingly fast! (EDIT: but only for small .svg s; try inkview /usr/share/inkscape/examples/*.svg* as the man page says, there are some heavies there too. Still, GUI startup is fast.) Thanks for that note, @DenilsonSá — cheers!
I had an SVG 32000 wide (yes, 32k pixels wide), inkscape showed it just fine, display could not load it.
One drawback of inkview is that it cannot autoreload if the svg file changes. While display has the -update 1 option, which autoreloads. I’ve tried to work around it by combining inkview with entr , but it’s kinda wonky.
Installed inkscape on mac using Homebrew (brew install —cask inkscape) but don’t see «inkview» command bundled along with it. Does it not come with homebrew installation or any other ways to install it
I usually work with SVG as text files, so would like the viewer to automatically refresh the display as soon as the file got saved (and its contents got changed) — this should be applicable to ‘pipable’ situations, I think (i.e. with named pipes).
Note that, for default Gnome apps:
- evince currently works like this for PDFs, but seemingly it cannot read SVG (for me it generates » Unable to open document — Error opening file: Permission denied » when I tried to load SVG files)
- eog (Eye Of Gnome) — the latest versions — can also detect if a file changed on this, and then offer a ‘Reload’ button; but apparently, you’d still have to click on ‘Reload’ each time (I cannot see a way to cause automatic reload always on file change in eog , like evince behaves with PDFs) — and also, at least on my Ubuntu 10.04, eog SVG support is somewhat broken (zoom in results with blurry lines)
- ImageMagick’s display not only does not automatically refresh when the file changes on disk — and even when you press ‘refresh’ in display , you still do not get the latest version of the file (meaning, you have to restart display to show the latest version 🙁 ).
Here are some more notes I found so far:
- Squiggle, the SVG Browser The SVG browser that is part of the Batik toolkit. — Download Batik batik-1.7.zip; unpack it; run java -jar batik-squiggle.jar and there it is; does not refresh the image automatically if the svg file changed on disk
- SVG Image Viewer? — Ubuntu Forums recommendations:
- In post #8 — «I wrote a little python script . You just run it as: svg_compare.py and it opens up an svg and displays it using an svg library and using gtk’s raster library. You can zoom with the mouse. «
- xsvg (from http://cairographics.org) — I installed libsvg1_0.1.4-1_i386.deb, libsvg-cairo1_0.1.6-5_i386.deb and xsvg_0.2.1-3_i386.deb in that order; those versions are from 2005, and so xsvg is extremely simple — no zoom, nothing.. And needless to say, it does not react to saved file changes automatically.
Yup — well, I hope this helps.
Cheers!EDIT (Dec 24 ’10): well, here is also my contribution: svg_refreshview.py — which is basically a rework of svg_compare.py mentioned above, that simply shows an SVG file, and reloads the file and refreshes the display if the file has been modified. (it can’t really work with stdin — but there are other scripts in my repo that parse stdin in python, maybe they’ll help).
EDIT2 (May 20 ’12): Also, came up with a Perl-Tk script example, which is very crude (no mouse interaction, no nothing), but uses ImageMagick Perl API, and so can render SVG (as bitmap on a canvas), please see answer #10670039 — ImageMagick API for command-line GUI application interface to display — Stack Overflow.
How Do I View A PNG File in Linux
Since the invention of the first camera in 1888, images and photos have been vital in conveying information and keeping evidence of events. With the rise of modern technology and social media, it’s now more important than ever to store, view, and edit images.
Being a popular and fantastic operating system, Linux provides a collection of tools and utilities for viewing and editing images. This tutorial discusses various ways to view a popular image format, PNG, in Linux.
What is a PNG file?
Portable Network Graphics, or PNG for short, is an image format that uses a 24-bit color system. It is ideal for storing digital art such as flat images, icons, and logos. PNG is a popular image format supported by a wide range of tools.
Advantages of PNG
The following are advantages of using the PNG file format:
- PNG uses lossless compression, thereby preserving image quality.
- It is suitable for digital media, making it ideal to use on web pages.
- It uses 24-bit color, which supports over 16 million colors.
Disadvantages of PNG
Disadvantages of using PNG format include:
How to Open A PNG file in Linux
The Linux operating system has a wide selection of tools you can use to open a PNG file.
However, due to the scope of this guide, we will only list the best ones based on our experience.
gThumb
gThumb is a lightweight and open-source image browser, manager, viewer, and editor. It allows users to perform various image operations in one tool.
To install it, use the command:
To launch the tool, use the gnome-search:
gThumb will launch in the Pictures directory. You can navigate the filesystem to the location of the image you want to view.
To launch the image from the terminal with gThumb, use the command:
NOTE: Replace the linux.png with the name of the png file you want to open.
Shotwell
Shotwell is a simple photo manager that comes pre-installed with Ubuntu systems.
It supports image imports, image organization, basic editing such as rotation, cropping, enhancing, and more.
To open a PNG image with Shotwell, search for the tool in the gnome-search tool and launch. This will import all images in the Pictures directory.
To open a specific tool, double-click the image from the list.
Feh
For terminal users, feh is a great tool to view PNG files. It is a lightweight and straightforward tool that uses command-line arguments.
To install it on Linux, use the command
To view a PNG image with feh, pass the file name as:
Feh will launch the image and window size respective to the image size. To control image display and how the tool works, consider the feh manual pages.
Nomacs
Nomacs is another popular tool you can use to view PNG images in Linux. It is free, open-source, and supports all major image formats.
To install nomacs on Linux, use the command:
To view a PNG image with nomacs, launch the tool. Then, in the top menu, select Open and navigate to the image location.
Conclusion
There is a vast collection of tools you can use to view and edit PNG images. The best image viewer to use depends on the necessity; if you are a terminal user, stick to terminal-based image viewers.
About the author
John Otieno
My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list
Просмотрщики
Просмотрщики графических файлов (фотографий, изображений, картинок) для Linux. Браузеры изображений для Linux.
Koko
Koko — простой просмотрщик изображений. Обладает минимальным функционалом. Разрабатывается в рамках проекта KDE.
Viewnior
qView
qView — простой, минималистичный просмотрщик изображений. Не имеет панелей управления и других интерфейсных элементов. Доступ к функциям осуществляется через контекстное меню или с использованием горячих клавиш.
Eye Of Gnome
Eye Of Gnome (eog) — простой просмотрщик изображений, разрабатываемый в рамках среды рабочего стола GNOME.
Nomacs
Nomacs — просмотрщик изображений с возможностями обработки фото. Поддерживает все популярные форматы файлов изображений, включая RAW и PSD. Имеет настраиваемы интерфейс.
Gwenview
Ristretto
XnViewMP
XnViewMP (XnView Multi Platform) — мощный просмотрщик изображений для Linux. Программа может выполнять функции менеджера фотографий (каталогизатора) и конвертера. Позволяет выполнять редактирование изображений, поддерживается экспорт в различные форматы. Поддерживает более 500 графических форматов файлов.
Geeqie
Geeqie — просмотрщик изображений для Linux. Поддерживает большое число форматов. позволяет просматривать изображения в RAW формате.
PhotoQt
Photo — стильный и легкий просмотрщик графических файлов для Linux. Главное отличие программы от аналогичных это ее внешний вид. Программа не имеет рамку окна и занимает весь рабочий стол, снизу же отображаются миниатюры изображений из директории.
GPicView
GPicView — простая программа для просмотра изображений в Linux. GPicView обладает самым минимумом функций для просмотра изображений (пролистывание, масштабирование, полноэкранный просмотр), а также может поворачивать изображение на 90 градусов. Программа работает очень быстро и занимает мало места в оперативной памяти.