Skip to main content
42 votes
Accepted

How to get the DPI of an image file (PNG)

You could use identify from imagemagick: identify -format '%x,%y\n' image.png Note however that in this case (a PNG image) identify will return the resolution in PPCM (pixels per centimeter) so to ...
don_crissti's user avatar
  • 83.4k
8 votes

How to get the DPI of an image file (PNG)

open it with "the gimp" and click [image] -> [image properties]
Jasen's user avatar
  • 3,771
7 votes
Accepted

Convert PDF to images in 1920x1080

This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice: use the -flatten option to ...
frostschutz's user avatar
  • 49.5k
5 votes
Accepted

Drawing a straight line with Pinta

This is easy: use Pinta's Line/Curve tool. In the screenshot below, my mouse pointer is over the icon for this tool: When you first run Pinta, the Tools area might be narrow and so you might not see ...
Adam Dingle's user avatar
5 votes
Accepted

Display a png image file on a framebuffer: png-fb source

I use fbi (frame buffer image) for that. Sources are also available for fbi improved
Philippos's user avatar
  • 13.5k
3 votes
Accepted

difference between convert -quality and convert -resize and convert -density

Since PNGs are lossless, compression on its own can only do so much, and reducing quality (with -quality) won’t help you cut the image file size to one-tenth its original size. Note that the value ...
Stephen Kitt's user avatar
2 votes
Accepted

How to read XML input in lstopo

You should be able to build a PNG file (containing a graphic rendering of your topology) from your XML file (which was created by lstopo) with the command lstopo --input out.xml --output-format png ...
G-Man Says 'Reinstate Monica''s user avatar
2 votes
Accepted

What is this GhostScript error? “/undefined in /BXlevel”

I'm noticing that you are using a very old GhostScript implementation. The error was reported to the GhostScript bug database in 2006 as bug #689876 (for releases 8.54 and 8.62) and should be fixed ...
Kusalananda's user avatar
  • 338k
2 votes

How to convert multiple XCF files to PNG?

same of @k0pernikus, but remove xcf extension from output filename for i in *.xcf; do xcf2png -f $i -o "${i%.*}.png"; done
Fabio C. Barrionuevo da Luz's user avatar
2 votes
Accepted

Convert pdf to png, size issue

pdftoppm appears to provide the following scaling options: -scale-to number Scales the long side of each page (width for landscape pages, height for portrait pages) to fit ...
steeldriver's user avatar
  • 81.7k
2 votes

Method to layout graphics file and pdf file for printing

I'm not sure what you mean by programmatically, so here are some ideas. These days, all output targets PostScript, which is itself a language, so you could write your requests in that, but it is a ...
meuh's user avatar
  • 51.9k
2 votes
Accepted

Merge a png on top of a gif with shell

You can do this using ffmpeg: ffmpeg -y -i layer2.gif -i layer1.png -filter_complex [0]overlay=x=0:y=0[out] -map [out] -map 0:a? mergedLayers.gif -y flag says to overwrite output files without asking. ...
Natolio's user avatar
  • 1,242
1 vote
Accepted

Is there a way to find all PNG files in a folder that have transparent pixels

Found a way using imagemagick. identify -format '%[opaque]' filename.png so where '$@' is the path to your image: #!/bin/bash case $(identify -format '%[opaque]' "$@") in [Ff]alse) ...
Cestarian's user avatar
  • 2,071
1 vote

Is there a way to find all PNG files in a folder that have transparent pixels

Use netpbm: pngtopnm -alpha filename.png | pgmhist If there's a row starting with value "0" the image contains fully transparent pixels If there's a number row other than value "255&...
Jasen's user avatar
  • 3,771
1 vote
Accepted

How to scan barcode in JPEG format with zbar in Linux?

The zbarimg program uses imagemagick to read the images. See the code here: https://github.com/herbyme/zbar/blob/068c810f75994b61ab9edc689650d09a0fc78bf9/zbarimg/zbarimg.c#L127 That deals beautifully ...
sina bala's user avatar
  • 491
1 vote

Why are my PNG files becoming corrupt so frequently?

This really sounds as if something in your self-designed software is still running and overwriting your files with the ones you call "corrupted". These aren't what people usually call "...
Marcus Müller's user avatar
1 vote

Thunderbird/X11 - pasting images from clipboard/primary selection fails unless I first paste to libreoffice

There is a workaround: Thunderbird can process images from the clipboard when they are offered as text/html and the content in the clipboard is the image encoded as base64 in an img html tag. This can ...
Homes2001's user avatar
  • 111
1 vote
Accepted

Why are my PNGs executable?

Any file can be tagged as executable. chmod 644 filename.jpg will remove the execute. This will give rw to owner, read to everyone else and remove execute. Make sure that is what you want. ...
Mark Stewart's user avatar
1 vote

Convert PDF to images in 1920x1080

Try: convert -resize 1920x1080 in.pdf out.png If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png Please ignore this answer: although useful for raster files resizing, it is ...
JJoao's user avatar
  • 12.2k
1 vote
Accepted

Tricky issue with stata and libpng

OK, so I solved my own problem. The following addition to the python script fixes my problem: import os os.environ['LD_LIBRARY_PATH'] = '' LD_LIBRARY_PATH is usually empty, but inherits the ...
Tobias's user avatar
  • 243
1 vote

Replace a certain color of pixels in a png with another png image

Wow I should have read the man page for convert more thoroughly. The answer is convert -flatten background.png items.png out.png
Display name's user avatar
  • 1,317
1 vote
Accepted

How can I save a scrollable terminal window (RoxTerm) into a png image?

You don't have to use a real screen of limited size. Create a virtual screen of the size needed to show all your output at once, then dump that screen or terminal. For example: $ Xvfb :1 -screen 0 ...
meuh's user avatar
  • 51.9k
1 vote

How can I save a scrollable terminal window (RoxTerm) into a png image?

I've been using asciienma.org (previously ascii.io) to create recorded sessions for tutorials that I need to embed/share of actions in a terminal. The recordings can be saved and downloaded into a ....
slm's user avatar
  • 372k
1 vote

How to get the DPI of an image file (PNG)

For exiftool tag names for PNG see the man-page Usage example $ exiftool -p "$PixelsPerUnitX,$PixelsPerUnitY,$PixelUnits" image.png 11811,11811,meters
user1016438's user avatar
1 vote

Create the same PNG with ImageMagick 2 times: Binaries differ

convert option -define png:exclude-chunks=date,time works as expected and creates always the same target binary file for "ImageMagick 6.8.9-9 Q16 x86_64 2018-11-11" (convert -v).
Gerrit Griebel's user avatar
1 vote

How to convert multiple XCF files to PNG?

Based on J. Auger's solution: find . -name "Amplicon*xcf" | parallel convert {} {.}.png
Ole Tange's user avatar
  • 35.7k
1 vote

How to convert multiple XCF files to PNG?

My one-liner using convert from imagemagik: for i in Amplicon*.xcf; do convert $i ${i/xcf/png}; done I had to keep my 'Amplicon' name because otherwise, it finds hidden xcf files in the directory and ...
J. Auger's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible