PDA

View Full Version : Linux Bash Batch Image Processing Script -bbips


Crouse
05-18-2005, 03:50 PM
I'm not sure if this is the correct forum to put this in, after reviewing the forums, I'm guessing it is. If not, could a mod please move it to the one you think is correct.

Anyway, I've started working on a script, a bash batch image processing script, bbips ;) It even has it's own website www.bbips.org What it is, is a Bash script (a long bash script) that will manipulate entire directories of Images (an entire directory of images all at once - not one image at a time) on your Linux system. I'm not sure if anyone here would even be interested in it, but I thought I would share it with you in case you were. It's still not real refined, but it works pretty well, I use it alot with all the images from our digital camera.

Some of the things it can do include

1) Rename all extentions (from JPEG to jpg etc etc)
2) Rotate Images
3) Create Thumbnails
4) Custom Resize Images
5) Resize Images to 400x400 max
6) Put Text on Images
7) Add Border to Images
8) Convert Images to Black and White
9) Flop Images Horizontally
10) Flip Images Vertically
11) Create photo gallery

and more......

The script makes use of ImageMagick and soon also jpegtran. I'm currently working on bulk removal of all exif data, and also to add specific exif data to images.... and also to add watermarks to images as well. The script is designed to be able to be run on a server via ssh or command line interface only..... so you don't need X to work with it.

The script is GPL'd and is just for fun and my benefit of learning Bash better. But since I've found it useful on many occasions, I wanted to share it. I would be very interested in hearing any suggestions on improving it from anyone, I know the code isn't real pretty ;) but it works for what I need it for.

http://www.bbips.org/images/bbips22.jpg

Let me know if you think of any suggestions for improving it..... (the script ---- not the website :D )

Download Current bash script:
http://www.bashscripts.org/downloads/Scripts/crouse/bbips/bbips0.2.3.sh
View script online:
http://www.bashscripts.org/downloads/Scripts/crouse/bbips/bbips0.2.3.txt

darksidepuffin
05-18-2005, 04:02 PM
Sounds fun -- I didn't download it and try it..but I might. Personally I prefer to write my shell scripts in php -- I don't much care for the syntax of bash.

Crouse
07-19-2005, 05:14 PM
I have updated the script quite a bit (approx 9 times since my first post).
Now at release 0.3.2
Also now hosted on sourceforge as well.

http://bbips.org
http://sourceforge.net/projects/bbips/
http://freshmeat.net/projects/bbips/

a couple of the menus from the program....

---------- Main Menu -----------

1) General Information
2) Batch Image Processing Functions
3) Create an Image Gallery
4) Change or View Image Information
5) Backup Images into Archives: (.tar .tar.gz .zip)
6) Change Current Working Directory (PWD)
0) Exit

-------- Image Processing Menu ---------

1) Main Menu
2) Rotate Images
3) Create Thumbnails
4) Custom Resize Images
5) Resize Images to 400x400 max
6) Put Text on Images
7) Add Border to Images
8) Convert Images to Black and White
9) Flop Images Horizontally
10) Flip Images Vertically
0) Exit

------ Image Information Menu -------

1) Main Menu
2) Read Comments on Images
3) Append Comments to Images
4) Over-Write Comments on Images
5) List Images Onscreen
6) Display an Image
7) Change Image Extensions
0) Exit


There's more..... the program just keeps on growing ;)

Crouse
08-18-2005, 02:02 AM
bbips.0.3.3.sh now out
https://sourceforge.net/project/showfiles.php?group_id=139927

Changes: Added to the main menu EXTRA FUNCTIONS. Used for misc functions that do not have a home in the menu structure yet, or that do not fit well in any of the other menus yet. Created in the EXTRA FUNCTIONS menu : Multiple Screenshot Tool Uses ImageMagick's import command and allows for delayed multiple screenshots to be setup.

www.bbips.org
https://sourceforge.net/project/showfiles.php?group_id=139927

jaomriess
08-18-2005, 04:32 PM
I am definately interested in this, I've tried writing my own BASH scripts to do similiar functions, scaling, adding comments, and creating chunks of HTML but it was pretty crappy, so I'll take a look, sounds good. Ahha! and it creates thumbnails at exactly the size I use, excellent.

jaomriess
08-18-2005, 04:40 PM
Actually, I'll probably not use the thumbnail function, I usually scale the image down to around 200px width or height and then change the canvas size to 100x100 and choose a portion of the scaled image, in an effort to keep people interested.

Maybe the script could scale each image so the longest side is 200px and the shortest side is > 125px and then use gimp-remote so the user can select the portion of the image to use as a thumbnail?

Crouse
08-19-2005, 03:14 AM
hmmmm haven't played with gimp-remote.... but interesting idea. So far, i'm still working with imagemagick..... i still have the gimp and gd to use when i run out of things to do ;)

jaomriess
08-19-2005, 08:50 AM
Well, I've only used gimp-remote to load something like somedir/*.jpg or gfx*/mylogo.jpg into an already running gimp. I don't know if it has other uses.

Rather than hardcoding a particular program, the prog could be set in a variable by user, to run after an image process performed on each image/thumbnail? (provided process not & bg ?):)

Crouse
08-19-2005, 04:18 PM
kinda kills that whole "batch" processing idea though ;)

I see what your saying though, and it could probably be put in as an extra feature ... i haven't ever played with gimp-remote, I'll definately have to check into it.

Thanks for your input. I appreciate it.

Pegasus
08-19-2005, 04:39 PM
Crouse, you're more than welcome to post your information in here. It's not something I know anything about, but I'm sure that there are quite a few people who would be interested.

Thank you for sharing the programme with us.

Pegasus

Crouse
12-16-2005, 06:35 PM
bbips.0.3.4.sh is now out.

Notes:
Just in time for Christmas ;)

Changes:
Added options to the Image Processing Menu that:

Colorize Images (Remove colors by channel)
Normalize Images (Contrast Enhance)
Paint Images (Simulate Oil Paintings)
Solarize Images (Simulate Exposing Film)

Fixed visual index creation function.
Now will use .jpg or .JPG

https://sourceforge.net/project/showfiles.php?group_id=139927

also available, the first german version... still has a bug or two though.

http://bbips.org/images/bbips34.png

Crouse
05-13-2006, 03:35 AM
bbips 0.3.5 released in march...
http://sourceforge.net/project/showfiles.php?group_id=139927

nox-Hand
05-13-2006, 09:48 AM
This looks interesting :) I shall take a look =)

nox-Hand

Crouse
10-11-2006, 12:35 AM
I released bbips.0.4.0.sh last night. I did ALOT of code cleanup and error checking and behind the scenes stuff to improve it. Many changes since the last release I posted here ;)

http://sourceforge.net/project/showfiles.php?group_id=139927&package_id=153489

Also, see the bbips command line utilities.... a bit more advanced, but allow the more experienced command line user alot of options when it comes to batch processing images.