matching image files to create one image


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting matching image files to create one image
# 1  
Old 07-20-2012
Bug matching image files to create one image

Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the two images into one image file (i.e. one file with the two A images).

The code that I have been working with is indicated below but the problem is that I cannot get it to work. Maybe there is an alternative way of doing this.

Code:
for f in *.cdt; do var=`echo "$f" | sed 's/\.cdt$//'`; convert +append $var.cdt.png $var.matrix.png $var_merged.png; done

Any help would be great
# 2  
Old 07-20-2012
Quote:
Originally Posted by kylle345
Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the two images into one image file (i.e. one file with the two A images).

The code that I have been working with is indicated below but the problem is that I cannot get it to work. Maybe there is an alternative way of doing this.

Code:
for f in *.cdt; do var=`echo "$f" | sed 's/\.cdt$//'`; convert +append $var.cdt.png $var.matrix.png $var_merged.png; done

Any help would be great
try with this..
Code:
for f in *.cdt.png; do var=`echo "$f" | sed 's/\.cdt\.png$//'`; convert +append $var.cdt.png $var.matrix.png $var_merged.png; done

# 3  
Old 07-20-2012
it still does not give output files. SmilieSmilieSmilieSmilieSmilieSmilieSmilie
# 4  
Old 07-20-2012
what errors you are getting.....

Code:
for f in *.cdt.png; do var=`echo "$f" | sed 's/\.cdt\.png$//'`; convert $var.cdt.png $var.matrix.png  +append $var_merged.png ;  done

# 5  
Old 07-20-2012
No errors show up... it is just that I dont get an output
# 6  
Old 07-25-2012
This is working as expected..

Code:
ls -lth
total 304K
-rw-rw-r-- 1 User User 36K Jun 29 05:13 cinama5d_2.JPG
-rw-rw-r-- 1 User User 261K Jun 29 05:13 cinama5d_1.JPG

convert cinama5d_2.JPG cinama5d_1.JPG +append new_cinema.JPG

$ ls -lth
total 596K
-rw-rw-r-- 1 User User 286K Jul 25 06:16 new_cinema.JPG
-rw-rw-r-- 1 User User 36K Jun 29 05:13 cinama5d_2.JPG
-rw-rw-r-- 1 User User 261K Jun 29 05:13 cinama5d_1.JPG

# 7  
Old 08-02-2012
Try this code:

Code:
for f in *.cdt.png
do
        var=`echo "$f" | sed 's/\.cdt\.png$//'`
        echo convert $var.cdt.png $var.matrix.png  +append $var_merged.png
done

Copy/paste its output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to backup (create image) SunOS 5.10 sparc?

Hello guys! I'm a newbee in Solaris systems. There is an issue, that I've got: I have to make an iso image of my solaris system. How can I do it? with dd utility? Clonezilla does not support spark, so it cant do backup. pls help! Is this solution: Creating a Solaris Flash Archive... (21 Replies)
Discussion started by: 2fat2fly
21 Replies

2. Solaris

How to Create ISO Image of a CD/DVD in Solaris 10?

Hi Solaris 10 Experts, How can I create an ISO Image of a CD/DVD from the cdrom to a temporary directory, and then use that image to burn it on a blank DVD in the cdrom in Solaris 10 1/13 OS environment? Please provide me with an example. With best regards, SS (1 Reply)
Discussion started by: ssabet
1 Replies

3. UNIX for Dummies Questions & Answers

How to create a UNIX ufs cdrom image?

Hello, I've got an Ultrix 4.2 ISO file (gxemul doesn't recognize it when I type gxemul -X -e 3max -d rootdisk.img -d Ultrix4_2.iso) So I read some other posts which show that this can be done via a UFS CDROM image. But I don't know how to create one. Anyway, I think the ISO file could be in... (0 Replies)
Discussion started by: lucky7456969
0 Replies

4. Red Hat

Create Linux gold image

I 'm new to linux .. can some one tell how can we create a linux image like solaris flash archive and then use it with kickstart server to build multiple clients from same image ? Thanks (4 Replies)
Discussion started by: fugitive
4 Replies

5. Red Hat

Need help to create netboot image for EL6 kernel

We use netboot to boot our RedHat Linux kernels. We usually use mknbi tool to create netboot image from Red Hat Linux kernel. However, I can't get this to work with the new Red Hat EL6 kernel. One online document I found seems to say mknbi should not be used for Linux 2.6 or newer kernels any... (1 Reply)
Discussion started by: jyao02459
1 Replies

6. Linux

Create an ext3 fs image

Which I will use as a loop mount mounted on an arbitrary directory, say /home/me/dir running something like mount -o loop ext3_image.img /home/me/dir What command(s) should I run to create this? I use RedHat. Thanks in advance (1 Reply)
Discussion started by: stevenswj
1 Replies

7. Solaris

Create an ISO image of whole system

Hi All, Please help me with this. My plan is to create an ISO image of my current solaris 8 OS.Because we use a stripped out version of solaris 8 which is different than the standard one in CD. Will dd command will do ? My idea is to create a VMware image from iso file and play it in... (6 Replies)
Discussion started by: Jartan
6 Replies

8. AIX

How do I create a bootable mksysb image file

I have several systems which require software maintenance several times a year. After the software maintenance, it is required that we make two system tapes for DR purposes. The creation of these system tapes takes anywhere from 1-1.5 hours because of the performance of the tape drives. What I... (7 Replies)
Discussion started by: acascianelli
7 Replies

9. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies

10. Solaris

How to create a disk image

I have a whole bunch of solaris machines. How do i create an image so i dont have to keep doing a reload and. In the pC world we have ghost what about the solaris world? (3 Replies)
Discussion started by: frankkahle
3 Replies
Login or Register to Ask a Question