Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open and edit images in Emacs

Tags:

emacs

I have searched a lot about opening image inside Emacs. I think ImageMagick will do the trick, but what I don't seem to be able to find is a way to use this inside Emacs and how to integrate it with Emacs?!

Besides, any better alternative will be appreciated.

like image 869
Arash Avatar asked Jul 24 '12 22:07

Arash


3 Answers

Use Image-Dired.

It is already included in Emacs. Just type M-x image-dired and choose an appropriate directory.

like image 155
Ehvince Avatar answered Nov 18 '22 14:11

Ehvince


Are you looking for something like the Emacs Image Manipulation mode? It uses mogrify from ImageMacgick.

like image 45
Jon Lin Avatar answered Nov 18 '22 12:11

Jon Lin


I am not sure what you mean. You can open an image "inside Emacs" just like any other file, just C-x C-f to find it, and C-c C-c to toggle the bitmap rendering.

Code-wise, it looks like this:

(defimage test-image
    ((:file "~/Pictures/greenbug.xpm")))

(insert-image test-image)

Or even simpler

(insert-image (create-image "~/Pictures/greenbug.xpm"))
like image 26
yPhil Avatar answered Nov 18 '22 14:11

yPhil