GitHub - walseb/blimp: A complete wrapper around all imagemagick commands with a...
source link: https://github.com/walseb/blimp
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
readme.org
Blimp - Bustling Image Manipulation Package
Blimp is a complete wrapper around all imagemagick commands with descriptions, autocompletion (for some commands) and hints displayed in prompt using eimp.el to execute its commands and resize images.
Features
- Supports all imagemagick commands
- Supports all completion frontends (ivy, helm, ido, etc)
- Writes changes to buffer instead of file allowing you to revert changes before saving
- Parameter autocomplete for some commands
- Description of command in prompt
- Description of input format for some commands
- Resize images to fit window or manually using the mouse
Install
(require 'blimp) (add-hook 'image-mode-hook 'blimp-mode)
Usage
First enter a image-buffer and type C-c C-i
to bring up the blimp-interface
. After choosing a imagemagick command and its parameters, do C-c C-e
to apply the chosen command(s) on the current image or C-c C-r
to clear all queued commands. You can also do C-c C-I
to apply the command right after selecting it and C-c C-p
to toggle the current command prefix between “+” and “-“.
If you want to resize the current image to fit the buffer you have several alternatives: M-x eimp-fit-image-height-to-window
or M-x eimp-fit-image-to-whole-window
or M-x eimp-fit-image-to-window
or M-x eimp-fit-image-width-to-window
Configuration
If you want to skip using blimp-interface
and instead have hotkeys for specific commands you can do
;; Prompts for amount of degrees to rotate then applies the rotation (defun my/blimp-rotate() (interactive) (blimp-interface-execute "rotate")) (define-key eimp-mode (kbd "C-c C-r") 'my/blimp-rotate)
Or if you want to run commands with all their paramaters already set
;; Rotates image 90 degrees when called (defun my/blimp-rotate-90() (interactive) (blimp-add-to-command-stack (list "-rotate" "90")) (blimp-execute-command-stack)) (define-key eimp-mode (kbd "C-c C-r") 'my/blimp-rotate-90)
To resize images using the mouse you can do
(define-key blimp-mode-map (kbd "<down-mouse-3>") 'eimp-mouse-resize-image-preserve-aspect) (define-key blimp-mode-map (kbd "<down-mouse-2>") 'eimp-mouse-resize-image)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK