Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Thursday, September 11, 2025

Image magick, reduce size of jpg files by 50%

 

for file in *.jpg; do magick "$file" -resize 50% "resized/$file"; done

Thursday, March 5, 2020

Friday, November 30, 2012

LaTeX tip & tricks

I recently discovered the "trim" option of the includegraphics command :
\includegraphics[trim=Wcm Xcm Ycm Zcm]{image-file}
%left bottom right top
Will remove Wcm on the left, Xon the bottom side, Ycm on the right side, and Zcm on the top side. Be careful when trim AND angle are used at the same time !

Thursday, July 12, 2012

Mettre un stamp sur une image

Avec convert (de Imagemagick), fonctionne bien avec la version :

$convert --version
Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP


#!/bin/bash
# stamp timbre A_marquer Img_finale

# (c) 2007-2010 by C.M.
# under the GPL License

# prendre deux fichiers d'images
# l'un étant un "sceau" et l'autre une photo
# et marquer la photo du sceau, en bas à droite (ou gauche)
# Image timbre
SCEAU="$1"
# Image à marquer
PIC="$2"
# Fichier de sortie
OUT_IMAGE="$3"
# Proportion du timbre par rapport à l'image
SCALE="/ 20"
# Texte ajouté sous le timbre
TEXTE=""


# dimensions de l'image à marquer
width_pic=`identify -format %w "$PIC"`
height_pic=`identify -format %h "$PIC"`

# dimensions du sceau
width_sceau=`identify -format %w "$SCEAU"`
height_sceau=`identify -format %h "$SCEAU"`

# dimensions auxquelles réduire le sceau
stamp_w=$(( $width_pic $SCALE * 2))
stamp_h=$(( $height_pic $SCALE))



Nettoyer les metadonnées d'images

j'ai pour cela trouvé jhead :
jhead -purejpg [img.jpg]
jhead is used to display and manipulate data contained in the Exif header of JPEG images from digital cameras. By default, jhead displays the more useful camera settings from the file in a user-friendly for‐ mat. jhead can also be used to manipulate some aspects of the image relating to JPEG and Exif headers, such as changing the internal timestamps, removing the thumbnail, or transferring Exif headers back into edited images after graphical editors deleted the Exif header. jhead can also be used to launch other programs, similar in style to the UNIX find command, but much simpler.

Monday, October 31, 2011

pdf and images without X

This software allows you to view pdf, images, etc. without launchning th X server. It just uses the framebuffer :-)


You can find it here :

Friday, October 14, 2011

CMYK, 300DPI and Linux (Ubuntu)

Wishing to participate in a graphic contest, I had to follow some strict rules:

  • Less than 5MB

  • "CMNJ" which I found is the french for "CMYK colors"

  • JPEG hi-def




It took me some time to find the appropriate tools for Ubuntu Linux, since Gimp was not much help with all that. CMYK seemed to be planned for the Gimp-v3.0, but all I found were comment on this "future release" (I'm now using "GNU Image Manipulation Program version 2.6.11", standard one with Ubuntu...).


DPI problem



I used the XnView tool to reset the DPI to 300.
xnview : (sudo apt-get install xnview was enough to install it !)


I found this tool following what is explained here : http://www.rideau-info.com/photos/changedpi.html.



CMYK problem



First of all, I had never heard about it, so I was gonna assume it was the default format... In French CMYK is called CMJN, and referred as "Quadrichromie" (opposed to "RGB"(en) "RVB"(fr) "trichromie").

Of course, the pictures I had were in RGB, so I had to convert them to CMYK.

I found a tool able to do that easily, coming on the side of the LittleCMS image library : jpegicc !

Hoping my quest was over, I read the doc on how to use it, and found that CMYK needed some "profiles definition". Looking around on the net, I found some distributed by Adobe doing a search on their website "research" tool. I then found a .zip, unpacked it and had RGB and CMYK profiles (~10 differents).



In order to test them, I applied all of them (in the folder "profiles/CMYK_Profiles/" ) to a sample file "test2.jpg" to see the resulting colors :
for i in profiles/CMYK_Profiles/* ; do jpegicc -o"$i" test2.jpg test2.cmyk--`basename "$i"`.jpg ; done


To the lazy ones, the command for a single profile (or to copy-past it) :
jpegicc -oProfile.icc file-In-RGB.jpeg file-Out-CMYK.jpeg


Those were rendering quite different colors at the end, and I said good bye to my white background.

Wednesday, September 30, 2009

Convert SVG to {png, eps, ...} with inskscape


inkscape -z --export-png=out.png infile.svg

Thursday, July 16, 2009

Jgraph, command line tool for graphics

Command-line graph production.

The input describe some plotting or curving with a language quite straightforward to read and write, and produces an image (ps, eps, gif, ...).


Main Website :
http://www.cs.utk.edu/~plank/plank/jgraph/jgraph.html

Some examples & first hands on Jgraph :
http://www.cs.utk.edu/~plank/plank/classes/cs494/494/notes/Jgraph/lecture.html

"Brief Description"
"Jgraph is a program that takes the description of a graph or graphs as input, and produces a postscript file on the standard output. Jgraph is ideal for plotting any mixture of scatter point graphs, line graphs, and/or bar graphs, and embedding the output into LaTeX, or any other text processing system that can read postscript. "


There are 2 JGraph, and the most referenced on the web search engines is a Java library. This is obviously NOT about that jgraph...