GithubHelp home page GithubHelp logo

walseb / blimp Goto Github PK

View Code? Open in Web Editor NEW
113.0 4.0 3.0 350 KB

A complete wrapper around all imagemagick commands with autocompletion, descriptions and hints displayed in prompt

License: GNU General Public License v2.0

Emacs Lisp 100.00%

blimp's Introduction

https://melpa.org/packages/blimp-badge.svg

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.

Blimp command building

Features

  • Should support all documented imagemagick commands (as of Aug 2018)
  • Supports all completion frontends (ivy, helm, ido, etc)
  • Writes changes to buffer instead of file allowing you to revert changes before saving
  • Undo and redo image changes with (setq eimp-enable-undo t)
  • Parameter autocomplete for some commands
  • Description of command and input format in prompt
  • Resize images to fit window or manually using the mouse

Install

(require 'blimp)
(add-hook 'image-mode-hook 'blimp-mode)

Usage

First enter an image-buffer and type C-c C-o to bring up the blimp-interface. After choosing a imagemagick command and its parameters, type 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-O 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)

Macros

When using the above commands in macros to quickly modify a lot of images, keep in mind that eimp.el (and by extension blimp-execute-command-stack) is async, so you need to wait for the command stack to execute before switching image. To do this i just add (sleep-for 0.2) at the end of the script, e.g. at the end of my/blimp-rotate-90. More complex commands might require more time to execute so keep this in mind.

blimp's People

Contributors

walseb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blimp's Issues

Command information not visible using ivy and eimp dependency

I just would like to see the IM command information, that can be seen in your screenshots. I'm using ivy but I can't see anything. Any idea?

EImp is from 2012. Is it still maintained? Is it a good idea to have such an old package as dependency? I'm not a coder it just seems odd to me.

By the way setq eimp-enable-undo t is great. It enables use of undo-tree-undo and redo for images. Maybe you should mention it in your readme since the default is nil.

Feature request: Predefined Parameter sets

I just though of the idea of predefined parameter sets. What do you think of it?

For example you call rotate but instead of entering a value you press a key and then you can select some default sets like +90,+180 and so forth.

Maybe it is possible to combine the predefined sets and the normal parameter entry in one level, so you don't need to press a key to get the predefined sets but I don't know if that is possible.

I assume there are sites on the internet that already have tons of usefull parameter sets that just need to be added.

Saving hangs

Saving (using C-x C-s) an image buffer after a blimp transformation (e.g. rotate) seems to hang forever.

I haven't investigated the issue at all for the moment. Can anyone reproduce?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.