INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: building an image library. (work in progress)  (Read 13332 times)

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
building an image library. (work in progress)
« on: September 01, 2006, 04:15:42 am »

Taking a small break from messing around with my photos, I've made a start on writing up what I've been up to. I didn't realise how involved it all was before I started.
I've got up to "creating the view schemes" and this is where things veer sharply away from a default MC installation.
I'm not going to write any more today. I said I'd write it up, and so I will, and I'll publish in its entirety once it's done, but it is, without question, not for the faint-hearted!

If anyone (batch file wizard?) knows if this is possible:
Can anyone suggest a way to select a file in MC, and then issue a command via 'send to..' to copy the file to a new filename and then open that new file in an editing program? If we could do that, it would smooth many wrinkles in one fell swoop.
please let me know. it would make a big (very positive) difference to quite a large chunk of this project :)

working sweetly. Thanks Dlone.

progress so far

dlone

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 264
Re: building an image library. (work in progress, does this make sense?)
« Reply #1 on: September 01, 2006, 03:54:41 pm »

Also, if anyone (batch file wizard?) knows if this is possible:
Can anyone suggest a way to select a file in MC, and then issue a command via 'send to..' to copy the file to a new filename and then open that new file in an editing program? If we could do that, it would smooth many wrinkles in one fell swoop.

Question
'Copy the file to a new filename'
Do you mean copy the file to a different folder, leaving the filename the same and start the editor ?
As written it's unclear what you mean  :)

[edit]
if that is what you mean you can make a .bat file something like this

copy %1 "C:\temp\%~n1"
photoshop "C:\temp\%~n1"


Is that any use to you?
ps %~n1 if just the filename, %1 if the full path

important
those 96's you can see are actuall percent symbols, but they show up strangely on this board (if you have the same font problem as me...)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #2 on: September 02, 2006, 02:20:40 am »

ahah, see what I mean. I'm hopeless with words!

What I wanted, for the time being at least, was to be able to make a copy of the file in the same directory, and I wanted _edited_1 appended to the filename.

You'll see where I'm aiming when I tell you that the closest I could get was:

copy %1 %1_edited_1

that almost worked, but it appended after the extension, giving me filename.jpg_edited_1

thanks for looking at this. do you think it's possible?

NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress, does this make sense?)
« Reply #3 on: September 02, 2006, 02:36:17 am »

It may be too obvious, but couldn't you just append the edited indicattor at the beginning of the filename?

copy %1 edited_1_%1
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #4 on: September 02, 2006, 02:41:15 am »

It may be too obvious, but couldn't you just append the edited indicattor at the beginning of the filename?

copy %1 edited_1_%1
Absolutely not.
Well, you probably could, but it would wreck everything else in the process. The first eight characters in the filename must remain identical, you see ;)

-marko.

NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress, does this make sense?)
« Reply #5 on: September 02, 2006, 03:20:51 am »

You could pass just the filename without the extension to the batch file, then
copy %1edited_1.JPEG
Logged

dlone

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 264
Re: building an image library. (work in progress, does this make sense?)
« Reply #6 on: September 02, 2006, 05:27:47 am »

ahah, see what I mean. I'm hopeless with words!

What I wanted, for the time being at least, was to be able to make a copy of the file in the same directory, and I wanted _edited_1 appended to the filename.

You'll see where I'm aiming when I tell you that the closest I could get was:

copy %1 %1_edited_1

that almost worked, but it appended after the extension, giving me filename.jpg_edited_1

thanks for looking at this. do you think it's possible?


Try

copy %1 "%~dp1%~n1_edited_1%~x1"

that should do it
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: building an image library. (work in progress, does this make sense?)
« Reply #7 on: September 02, 2006, 06:38:09 am »

This free tool might be useful:

Batchrun 4.1, http://www.outertech.com/index.php?_charisma_page=product&id=1
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #8 on: September 02, 2006, 06:55:20 am »

:) result :) (very, very, small, insignificant question: is there a way to stop the command.exe window from showing?)

@echo off
copy %1 "%~dp1%~n1_edited_1%~x1"
"C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"

You've no idea how good this is. What a result. Nice one dlone, thank you.

now I just need to find a tutorial that will teach me how to fix red eyes, when the default 'click on the eye' tools do this instead...



(Alex, thanks, I'll bookmark it, but I think we're all sorted now)

-marko.


NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress, does this make sense?)
« Reply #9 on: September 02, 2006, 06:58:23 am »

Markko, I assume that this is the last step in edited image and rollback to original??
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: building an image library. (work in progress, does this make sense?)
« Reply #10 on: September 02, 2006, 07:11:53 am »

marko, could you upload the original image? I started to write how I would do the fix, but I realized that I intuitionally use various different techniques (in Photoshop) depending on the particular case.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #11 on: September 02, 2006, 07:23:55 am »

NickM, right now, I can't go into too much detail, but what this does is save a gazillion mouse clicks involved with syncing the tags of the original file and it's new, edited version.
It also means it's now possible to filter a list of files that need editing down to a single file, send that file to the batch, perform the edit, and have the new image show up right there beside its original, all with the absolute minimum input requirements from the user, which is exactly what I was after. Most excellent.

I wasn't kidding when i said that this setup was a tad on the complex side, but once it's set, you can forget about that and get on with building/maintaining an image library in MC. I'm in the process of writing it up at the moment, but it may take a few days or so to get done properly...

99% of the time, there'll probably only be 1 edited version, hence a rigid filename rule above.
At risk of becoming a pain in the proverbial, I wonder if it's possible to 'auto increment' the filename, so that if _edited_1 already existed, it would use _edited_2, and so on?

Alex, right click, save as... (3.32 mb)

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: building an image library. (work in progress, does this make sense?)
« Reply #12 on: September 02, 2006, 09:16:50 am »

Oops, that was really difficult. I am afraid that I cannot give any specific instructions. I worked with the picture a few minutes. This is about the best I could do without completely repainting the eyes (and spending an hour or so):

 

I used
- about all selection tools (elliptical, lasso, magic wand, feather, expand etc)
- the saturation, curves and level adjustments
- the eraser, clone stamp, blur and dodge tools

Here is the edited part in a lossless format: IMG_3212_edited.png
- in case you would like to paste it over the original image or continue editing. Perhaps the left pupil is still a bit too dark...   ;)
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #13 on: September 02, 2006, 09:57:11 am »

saved it, thank you Alex. I guess the key is 'practice'  then. I've spent hours in the past trying to repaint some of our pets' eyes that came out practically white rather than red. You've achieved an almost natural look, way better than anything I've managed so far...

I find it interesting though, especially when you get right in close, so will keep practicing. I have a lot of red eyes here!!

NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress, does this make sense?)
« Reply #14 on: September 02, 2006, 10:09:57 am »

Marko, I am sure that you could use a combination of an 'if' statement to check whether it exists in the firstplace and a search and increment for the verison number, but...

Wouldn't it be better to store the version number as a tag with the original, and then append that to the strings passed to the batch file, i.e. send to, external editor %1, %2
(filename, version)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #15 on: September 02, 2006, 10:48:33 am »

I'm not sure. We're tip-toeing into areas I'm not so familiar with, but, I believe that the only thing that can be passed to the batch file, or any other external tool, is the filename. I'm not really sure what else, if anything, is valid input for the parameters field.
Also, bear in mind that as you begin to build your library, there will be two distinct phases.

phase 1 involves setting it up and bringing all existing images into line with your chosen setup.
phase 2 involves keeping newly aquired images neatly organised and tagged in line with your chosen setup.

It's quite a lot of work, I'm finding this more so than with audio files as images are not as linear in their definitions, so we really want to get the software to do as much as possible for us. The less we need to track ourselves, the less chance there is that steps get forgotten about, or dismissed 'untill tomorrow'.
This was my aim when I set about building my MC image library. I don't mind spending some time setting it all up, so long as when it's all in place, the 'low maintainence' value makes it worthwhile. If a library setup is generating too much manual work, it's no good. Naturally, the definition of "too much" will vary from person to person.

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: building an image library. (work in progress, does this make sense?)
« Reply #16 on: September 02, 2006, 10:54:58 am »

saved it, thank you Alex. I guess the key is 'practice' then. I've spent hours in the past trying to repaint some of our pets' eyes that came out practically white rather than red. You've achieved an almost natural look, way better than anything I've managed so far...

I find it interesting though, especially when you get right in close, so will keep practicing. I have a lot of red eyes here!!

As you surely know, it would be better to try to avoid the problem instead of trying to fix it afterwards.

Can you use a separate flash unit with your camera? Indirect reflected lighting would look better and completely elimate the problem. Also, switching all room lights on helps a bit because the pupils are smaller then.

If no nearby white or light reflective surfaces are available you could try to lift the flash well above the plane of camera's lens. Many flash units can be used with an extension cord.

Also, gadgets like the Lumiquest bouncers are useful because they lift the light source higher (besides softening the harsh flash light).
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #17 on: September 02, 2006, 11:02:07 am »

naturally. I do try. I only have a small, Canon compact digi-cam, it's a Digital Ixus 700.
I notice the problem is much worse with the Canon camera than with my old Kodak easyshare LS443, possibly caused by the smaller size (flash being closer to the lens?)
I don't think there's a way to hook up an external flash. I'm hoping my next camera will a little more substantial, but that's quite a way into the future yet.

dlone

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 264
Re: building an image library. (work in progress, does this make sense?)
« Reply #18 on: September 02, 2006, 11:10:59 am »

(very, very, small, insignificant question: is there a way to stop the command.exe window from showing?)

@echo off
copy %1 "%~dp1%~n1_edited_1%~x1"
"C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"

You could try changing
"C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"
to
start "C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"

that way the command prompt will disappear as soon as photoshop starts
Logged

NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress, does this make sense?)
« Reply #19 on: September 03, 2006, 04:00:54 am »

You can pass multiple parameters to the batch file.  %1, %2, %3 - I seem to remember the limit is 8 parameters.  Keeping the version number in MC would allow longer term flexibility to track what has been done, and how many versions, because MC is more realistically a real database.  Whereas the version control outside would effectively only be incremental filenames, and to discover what is in existence, then you would have to read and scan the filenames in a particular directory.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #20 on: September 03, 2006, 04:41:12 am »

You could try changing
"C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"
to
start "C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"

that way the command prompt will disappear as soon as photoshop starts
I don't fully understand what's happening here...
The batch file, exactly as I posted it in reply #8, was closing the command window as soon as photoshop started.
But when I returned to playing around with this later in the day, the window remained open. Odd.
I added another line, exit, to the batch, and then tested again, the window closed, and I was happy again.
On returning to it again this morning, the window again, remained open.

I then decided to follow your quoted advice, and quite inexplicably, with start at the beginning of the line, the file opens in the AcdSee image viewer!!! (but the command window does indeed, close)

After reading everything shown in "help start", I removed the 'exit' line, and changed the 3rd line to read:

start /D"C:\Program Files\Adobe\Adobe Photoshop CS2\" Photoshop.exe "%~dp1%~n1_edited_1%~x1"

I *think* it's now working as expected. Works well with multiple selections too, which is nice.

You can pass multiple parameters to the batch file.  %1, %2, %3 - I seem to remember the limit is 8 parameters.  Keeping the version number in MC would allow longer term flexibility to track what has been done, and how many versions, because MC is more realistically a real database.  Whereas the version control outside would effectively only be incremental filenames, and to discover what is in existence, then you would have to read and scan the filenames in a particular directory.
What happens at the moment is a calculated field inside MC automatically groups files into version sets.
I'm still not really understanding what it is you're suggesting. I recall your post in the 'mimicing' thread, where you appeared to be suggesting that we keep all the tag info in the original file, but have MC display the edited file instead.
If I got that correct, and here, we're talking along the same lines, then I don't think we can achieve this.
We cannot redirect MC from one file to another internally via a tag.

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Re: building an image library. (work in progress, does this make sense?)
« Reply #21 on: September 03, 2006, 12:26:55 pm »

:) result :) (very, very, small, insignificant question: is there a way to stop the command.exe window from showing?)
Once you have a batch file, make a shortcut to it, will create a file with a .lnk extension. You want to call this .lnk from MC's Send To external instead of the batch file.

In win explorer, single click the .lnk, followed by Alt + Enter (Properties)
Look for Run (2nd last from the bottom) and select minimised.

Not possible to get rid of the DOS window entirely without getting more complex, but this way it will open in the taskbar and dissapear shortly after it completes.

I'm not sure. I believe that the only thing that can be passed to the batch file, or any other external tool, is the filename. I'm not really sure what else, if anything, is valid input for the parameters field.
This has been my observation as well, the filename is the only thing that can be passed to an external program.  Also the batch file will get called n times as there are n items selected in MC before sending to external.

There have been times when i've wanted to process all items in a folder and have had to train myself to only select one item in MC and then let the batch file get on with the job.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #22 on: September 05, 2006, 06:07:35 am »

hit_ny, interesting. I've yet to revisit the options, but I found that using the shortcuts, MC replaced the path to the shortcut with the direct path to the .bat. Also, interesting that's possible to send a single file to a .bat file, and have the .bat then work on all files in the directory, I may come back to you regarding that later :)

Now then...
should I write some more?
http://yabb.jriver.com/interact/index.php?topic=27426.0

hit_ny

  • Citizen of the Universe
  • *****
  • Posts: 3310
  • nothing more to say...
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress, does this make sense?)
« Reply #24 on: September 05, 2006, 01:54:54 pm »

I found this rather interesting jpg editor, BetterJpeg, http://www.betterjpeg.com/

interesting for two reasons:

1. it claims to only recompress the changed pixels when saving the file. If you only fixed red eyes, then only the eyes get recompressed, the rest of the file is preserved.
2. when saving a file, it can preserve all metadata, and that includes the proprietry MJMD tags, something even MC can't do!!

I might front up for a liscence for this. Still trialling, as an editor, it is very basic.

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1356
Re: building an image library. (work in progress, does this make sense?)
« Reply #25 on: September 10, 2006, 06:19:26 pm »

Marko!

I'd like to vote that a thread listing your more useful image threads and posts be stickied at the top of the forum :) Until, of course, JRiver incorporates them into the program ;)

It's good to see MC finally competing with the more heavy-weight image handling programs out there, even if it's through user developed workarounds :D
Logged

Jaguu

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1336
Re: building an image library. (work in progress)
« Reply #26 on: September 11, 2006, 12:40:03 pm »

Hi marko,

thanks a lot for the very detailed instructions. There was a lot to learn reading them. I personally don't go to such a depth for the time being as most of my images are simply downloaded from the internet (about 25'000) or photos received from family and friends.
I am a very visual person (much more than audio) and like to collect and watch image slide shows all the time, but take very few pictures myself. The little editing I do is cropping edges. But I definitely like the stack concept.

The database structure I use is very similar. I was just wondering why you introduced a field "subject". I use "genre" and a user field "subgenre"  for that. Genre is the standard field, while subgenre is a list field.
If you keep genre unique, it works very well. At the beginning I also had genre as a list field (named genres), but found it rather confusing having 2 list fields as a hierarchy and I wanted to have some specific hierarchy.

This is my top level genre list (in brackets some examples of subgenres):

Animals (Birds, Butterflies, Cats, Dogs, Elephants, Horses, Polar Life, Tropical Fish, Wild cats, Wild Life, Whales)
Animations
Architecture (Amusement Parks, Bridges, Canal&Dams, Castles, Churches&Cathedrals, Cityscapes, Covered Bridges, Harbour&Ports, Historical Buildings, Historical Places, Homes&Cottages, Lighthouses, Monuments&Memorials, Pyramids, Ruins, Sightseeings, Skyscrapers, Temples&Holy Places, Town&Villages, Watermills, Windmills)
Arts (from Gothic Art, Renaissance Art, Classical Age, Impressionism, Cubism to Modern Art, 16000 picturews altogether)
CD Labels
ClickArt

Entertainment (Aphorism, Dancing, Fireworks, Folklore&Traditions, Hot Air Ballons, Leisure)
Events (Birthdays; Jubilees, Parties; Vacation; Celebrations, Journeys, Outings)
Fantasy&Magic
Flowers&Gardens (all kind of flowers including Japanese Gardens, Natural Gardens, Wild flowers)
Graphic Arts
Holidays (Christmas, New Year, Eastern; Halloween)
Nature (38 different subjects)
People (Family&Friends; Celebs; Historic; Folklore)
Science-Fiction (Startrek, Babylon 5 etc)
Space (Planets&Moons, Space Travel; Deep Space, Clouds, Satellite Images)
Sports (all kind of sports)
Technology
Travel (Planes, Roads, Ships, Trains, Cars)

Altogether: 154 subgenres.

Most images are also tagged by continent, country and places. For the US I use the state as a country (US Alabama etc.). Places is usually a city or region.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #27 on: September 11, 2006, 02:54:36 pm »

Interesting stuff jaguu. thank you for the contribution.
The answer to "why use [subject]?" is probably "because I can". There's no specific reason behind it really. Loading the [genre] field here, I see that at some point, I began using that field, probably during the course of one of my previous failed attempts.

You use [genre], [subgenre]
I use [subject], [keywords]
This is an area that I always a little unsure about. You say you have 154 subgenres, and I have 112 keywords, plus 46 entries in a new field I created called [animals]. I made that field and then moved all the animals out of [keywords] into it because I felt that [keywords] was getting a tad unwieldy. At the same time, I can't help the nagging feeling that I'm not fully grasping the concept of a [keywords] field, and am probably not getting the best out of mine. I shall take a closer look at all of this for sure.

Re. stacks and version sets...
In the tutorial, I mention using Kingsparta's 'replace master' to get all the filenames to follow a uniform template. This is primarily to get version sets to work. The idea being that when saving an edited file, you keep its original name and append 'edited' to it. This makes it possible to automatically group the files based on the original filename.
If you don't need that, things suddenly become a whole lot simpler as you can skip the filename steps entirely, as files in a stack could be named anything at all, all that matters for stacks to work, is that after grouping them in a stack, you pick an image to be "top image".

NickM

  • Citizen of the Universe
  • *****
  • Posts: 630
  • Simplicity isn't always best, but it's easy to fix
Re: building an image library. (work in progress)
« Reply #28 on: September 12, 2006, 04:03:28 am »

Markko, I have now read, re-read and nearly understand your wonderful explanation of how to sort images.  I have tried creating a few views, and tags as you have outlined.  I now have a suggestion for me (because I have no doubt missed some complexities) and for others who may be too daunted to even start what you have created...

Please can you create a sample library, with your workshop schemes, together with a few sample files with their appropriate tags, zip it all up and post it?   It would be SO much help...

Thanks, nick
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #29 on: September 12, 2006, 06:05:32 am »

Please can you create a sample library, with your workshop schemes, together with a few sample files with their appropriate tags, zip it all up and post it?   It would be SO much help...
Interesting idea. I will definately look into that as I'm painfully aware that what is simple for me to visualise, is not so simple for me to write out in words and pictures, and for that short-coming, I can only apologise!

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress, does this make sense?)
« Reply #30 on: September 13, 2006, 09:33:32 pm »

You could try changing
"C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"
to
start "C:\Program Files\Adobe\Adobe Photoshop CS2\Photoshop.exe" "%~dp1%~n1_edited_1%~x1"

that way the command prompt will disappear as soon as photoshop starts

I wish I had been paying attention to this thread earlier.  I could have been all sorts of help... Either way, this is easy to fix.  Don't use a BAT script.  Write it in Windows Scripting Host instead...

Check out this script I wrote to switch display modes on my HTPC.  It executes a BAT file (which then shows the command window, but that wasn't my goal), but you could just as easily use your commands directly in the script.

Code: [Select]
<package>
   <job id="vbs">
      <script language="VBScript">
         set WshShell = WScript.CreateObject("WScript.Shell")
strWavFile = "U:\system\scripts\tv_mode\disable.wav"
WshShell.Run "Sndrec32 /play /close """ & strWavFile & """", 0, True
WshShell.Run "U:\system\scripts\tv_mode\standard_mode.bat"
      </script>
   </job>
</package>

You just save that to a TXT file and then rename it to .wsf (which makes it "executable").  That way you can double click on it (or call it from MC's Send to External function).

WSH (Windows Scripting Host) scripts don't create any "command window" or UI of any kind (at least not by default, there is an option you can turn on that displays them in a command prompt window).  Anyway, this is an easy way to execute "batch like" commands but show no window.  Plus, if you learn a little scripting, you can do really cool and powerful things with VBScript (or C# Script).

Here's a really cool WScript.Shell tutorial (great for beginning):

http://www.microsoft.com/technet/community/columns/scripts/sg1002.mspx

You can learn more about the WScript.Shell object and it's run and exec methods here:

http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx?mfr=true

There's a bunch of cool stuff about the WScript object here:

http://www.johnrostron.co.uk/bill/troubleshooting/programming/windows_scripting.htm
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress)
« Reply #31 on: September 13, 2006, 10:07:16 pm »

I thought I'd mention as well... Regarding WScript.Shell.Run.  Did you notice on this line above:

Code: [Select]
WshShell.Run "Sndrec32 /play /close """ & strWavFile & """", 0, True
The last two parameters, 0 and "True"?  You can use these to change how the Run method works.  That's how in my script I have it run the "soundrec32" app to play a sound but not show the UI of the sndrec32 application.  It's also how I have the script wait for the sound to finish playing before continuing.

The second parameter (the 0 in the above example, the first parameter is the command line you want run) is an integer that corresponds to hide, minimize, maximized, and so on.  0 hides the application completely.  That MSDN article I linked above (and here) has the full list of available integers (there are 10 options).

And, from the above linked tutorial:

Quote
The third parameter accepted by the Run method will enable us to prevent the programs from running concurrently. The third parameter can take a value of True, which indicates that the script should wait on the line where the Run method is used until the invoked program finishes running. We already know what happens if you don't specify this parameter, it defaults to false and you end up having programs run simultaneously.

Also, here's another cool MSDN article I use often on how to send keystrokes using Windows Script.

Anyhow, here's a modified version of the script above which executes a BAT file, but doesn't show a command prompt window even for a second!

Code: [Select]
<package>
   <job id="vbs">
      <script language="VBScript">
         set WshShell = WScript.CreateObject("WScript.Shell")
strWavFile = "c:\temp\scripts\test\test.wav"
WshShell.Run "Sndrec32 /play /close """ & strWavFile & """", 0, True
WshShell.Run "c:\temp\scripts\test\test_bat.bat", 0, False
      </script>
   </job>
</package>

Another thing to mention.  All that <package><job id="vbs"> stuff in the thing above is XML.  It's basically a special wrapper that allows you to directly execute the script by double clicking it (or running it via Start --> Run) when you rename the file to *.wsf.  Just copy and paste what I've used and put your scripts inbetween the <script></script> tags.

The other thing I should briefly address is this line:

Quote
set WshShell = WScript.CreateObject("WScript.Shell")

If you're not familiar with OOP (Object Oriented Programming) at all this might be the trickiest part of the script to understand.  Basically, you are creating a special programming "tool" called an Object (in this case you are creating a WScript.Shell type of object), and giving it a name "WshShell" in my example.  The name can be anything you want ("steve" or "whapbobbaloobopawhapbamboo" would have worked just as well).

From then on, to access the "functions" available to you via that object (these functions are called "methods" in programming parlance), you put the name of your object (WshShell or steve or whatever) a period and then the name of the method you want to "call".  The WScript.Shell object has lots of methods, and Run is only one of them!

Suffice it to say that that fancy line creates the WScript.Shell object that you are going to use and is a required step.  You don't have to call your object WshShell like I did, but whatever you do call it, you'll want to use that name from then on to use the object.

I actually made a ZIP file containing some files to make my little "test" script run (from above).  If you want to check it out, download this zip file: http://www.geocities.com/ri0n/mc/test.zip

Then extract it's contents to C:\temp\scripts\test\

Double clicking on the two WSF files will show you the difference.  You can right click on them and choose Edit to pop them open in Notepad to check them out (just like a BAT file).

Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress)
« Reply #32 on: September 13, 2006, 10:37:14 pm »

I'm not finished reading through this thread either but... There are so many better ways to get rid of redeye in Photoshop.

Try this quickly:

  • Make a duplicate of the "background layer" to a new layer.  To do this, right click on the background layer in the Layers Pallate and choose Duplicate Layer.  Leave the background layer there but select your new layer as the "active" layer (just click on it).
  • Zoom in on the eyes and modify this duplicate layer to eliminate the redeye.  There are lots of ways to do this, but the easiest is usually the Hue & Saturation tool under Image --> Adjust.  You can pay absolutely ZERO attention to what's happening to the rest of the picture... Just concentrate on the red part of the eyes themselves.
  • To effectively use the Hue-Saturation tool, set:
    • Set Edit to "Red" (rather than "Master").
    • Hue all the way over to the right
    • Drag the sliders at the bottom around until you get her "eye color" selected (and less of the surrounding stuff is effected).  The "inner band" is fully selected and the "outer band" is a gradual fade out of the "selection".  I turn the Hue control way up so I can easily see what I'm selecting.  You can use the Eyedropper tool in the image itself to automatically "select" the color of the item your trying to adjust (though you usually still have to tweak the sliders a slight bit).
    • Once you're satisfied with your selection then adjust the Hue, Saturation, and Lightness to make them actually look human (as I said, don't worry AT ALL about how the rest of the picture looks, just the eyes!)
    • Another, simpler, option is to just do Image --> Adjust --> Desaturate to your duplicate layer.  Then open the Image --> Adjust --> Levels tool and drag the middle slider to the right to make the pupils darker (if needed).  This isn't quite as nice because the pupils of someone's eye are never quite true black.  I always end up turning the Saturation and Lightness WAY down when using the Hue/Sat method, but a tiny smidge of color helps (I think).  If you're lazy, just use the Desaturate/Levels method.

  • When you're done, make a layer mask on the layer you just modified. You can do this by selecting the layer and then clicking the button on the Layers pallate that is a Square with a round circle in the middle of it (I think -- I can't get to my machine that has Photoshop installed right now, I'm on the HTPC and my wife is doing homework on the other one it is, I checked).  If not, check the help for "layer mask" and make one.

  • This will put another "square" icon next to the icon for the layer you're working on.   This is sort of the "mask's icon".  Select it by clicking on it.  You can switch back and forth between "edit the layer mode" and "edit the layer mask mode" by alternately clicking on the layer's icon and the mask's icon in the layers pallate.  Anyhow, select the layer mask so that it's active.
  • Grab your paint bucket tool, make sure you have full black (as black as black can be) selected as the foreground color, and click on the image.  You can skip this step by holding ALT on the keyboard when you click the "Square with Circle" Add Layer Mask button in the step above.  When you do that, it adds an "all black" Layer Mask instead of an "all white" one.

  • You should see the original, unedited image appear in place of the weird one you just made.  That's because the mask "blacked out" the whole layer you just made.
  • Switch the foreground color to All White and grab your paintbrush.  Zoom WAY IN, down even to the "pixellized" level.  Shrink that paintbrush down to a reasonable level, and get a soft brush (right click and change the Hardness slider down to 33% or so).  Also, drag the opacity slider down to 35-40% or so.
  • Now, when you "paint" with the white  brush, you'll see the effect magically come back everywhere you paint a little at a time.  You can "paint away" the red eye by painting "white" onto your "all-black" layer mask.  I had you turn the opacity way down (and the hardness way down) so you can precicely control the "amount" of the effect you want to "reveal".  What the white is doing is essentially "erasing away" the mask to reveal the layer "beneath" it.  A layer mask works by hiding anything that is "masked out" with black (or a shade of gray for "partial masking") and letting the layer or layers below it "shine through".  If you mess up at all, no big deal, just switch the foreground color back to black and "paint away" the edits (just the opposite of what using White does).

Layer masks are almost always quicker than using the selection tools (even quickmask often) if you're trying to effect only a part of the image (and especially if you want "soft edges" on that part).  It's easier to "paint" visually like that, and you can easily make sure you don't do too much.

EDIT (I got the computer and got to play with Photoshop a bit): Once you get the hang of it, you can do stuff like this here in a matter of minutes (it took me all of 3 minutes to give her blue eyes).  That actually wasn't a perfect example for the method because it was such low resolution that the edits completely "blew out" her pupils.  Normally, you'd still be able to salvage the pupils and all the texture details of her irises on a high-res image.  Here's a TIF of the same image so you can check out the layers: http://www.geocities.com/ri0n/mc/blueeyes.tif

The even better thing is that you can actually apply those masks to whole groups of layers (and copy and paste the masks from one layer to another), so that along with the layer "mode" settings and their individual opacity sliders, you can combine multiple separate effects into one composite image.  Try it out and play with it a bit.  You'll be amazed at what you can do.

Oh, and sorry if I described any of this wrong.  Like I said, I'm on the couch!  I'll check it from work tomorrow and fix anything I messed up.

Oh, and one other tip.  The filters under Effects (like Gaussian blur)?  They work on layer masks too.  They work great to soften an effect...  Also make sure to play with the layer's modes (EG. try making some edits and setting it to multiply then playling with the opacity slider)...

EDIT: As a good example, I went and modified this image from my Flickr site:



Here's the result (took about 5 minutes)...

 

As you can see.  Her irises are fine and the "glint" in her eyes is preserved!  You can click on the fixed image above and go to the Flickr site to see the higher-res versions too (just click the "All Sizes" button).

EDIT: Went through and "grouped" all of the Image editing stuff together into this post, and reformatted some of the other stuff above to make it make more sense.  Also uploaded the "fixed" image from my example to Flickr so I modified that too...
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress)
« Reply #33 on: September 14, 2006, 12:59:39 am »

Another example of something fun you can do with Layer Masks.  That's how they always do these shots (though, unlike me, they usually pick a picture of a little girl holding the flower in her hand, or a hot woman holding it in her teeth):



If you want to see how I did it, you can download a lower-resolution TIFF here:

http://users.adelphia.net/~edandjenn/mc/weird_flower.tif

PS.  I accidentally "exceeded my hourly data transfer limit" on my Geocities account, so all the stuff above that's linked to the Geocities page might not work for the next hour or so.  If so, sorry, try back later.  That's never happened before... I just uploaded the big TIFF to it and that bumped it over right away...
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #34 on: September 17, 2006, 02:02:42 pm »

I found this rather interesting jpg editor, BetterJpeg, http://www.betterjpeg.com/

interesting for two reasons:

1. it claims to only recompress the changed pixels when saving the file. If you only fixed red eyes, then only the eyes get recompressed, the rest of the file is preserved.
2. when saving a file, it can preserve all metadata, and that includes the proprietry MJMD tags, something even MC can't do!!

I might front up for a liscence for this. Still trialling, as an editor, it is very basic.

found another handy image tool today, freeware this time, which is always the right price. It's called 'Visipics' and it finds duplicate pictures.

--------------------------

glynor... wsh? eek!!
Thanks for the red-eye tips too. They're always handy.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress)
« Reply #35 on: September 19, 2006, 01:14:00 pm »

glynor... wsh? eek!!
Thanks for the red-eye tips too. They're always handy.

Just thought I'd mention... the WSH stuff looks scary, but it's really not.  And even if you're afraid, you can simply use the script I've provided to run your own BAT files without seeing a command window!  Simply edit the line:

Code: [Select]
WshShell.Run "c:\temp\scripts\test\test_bat.bat", 0, False
And insert the path to your own BAT file.  (Also remove the two lines related to making the noise of course, unless you want it to beep at you.)  This is especially nice for running scripts automatically on a schedule.

Once you have a batch file, make a shortcut to it, will create a file with a .lnk extension. You want to call this .lnk from MC's Send To external instead of the batch file.

Unfortunately, this "Shortcut" method of minimizing the command window doesn't work when the BAT file is called by Scheduled Tasks.  Until I utilized this method, I was always seeing command windows interrupt my video watching (due to my scripted library share method).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: building an image library. (work in progress)
« Reply #36 on: September 19, 2006, 01:20:15 pm »

Also, related to the "Layer Mask Painting" (my name for it) method I described above...

That method can be useful for a lot more than just red-eye removal and silly effects.  Some of the things I use it for regularly are:

  • Selectively Sharpening:  Instead of the duplicate layer, use an Unsharp Mask Adjustment Layer and sharpen to your heart's content... Then, you can "paint in" the sharpening only where it's needed and leave the rest of the image alone!
  • Selective Color Adjustments: Quite often I have images where the background colors are perfect and beautiful (the sky and grass and rocks and whatnot) but the skintones are a mess (or vice-versa).  You can use the same method I described above to selectively modify the skintones and then "paint-in" the effect so it doesn't mess with the background colors.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #37 on: October 27, 2006, 05:35:17 am »

Markko, I have now read, re-read and nearly understand your wonderful explanation of how to sort images.  I have tried creating a few views, and tags as you have outlined.  I now have a suggestion for me (because I have no doubt missed some complexities) and for others who may be too daunted to even start what you have created...

Please can you create a sample library, with your workshop schemes, together with a few sample files with their appropriate tags, zip it all up and post it?   It would be SO much help...

Thanks, nick
hokay folks...
I took a break from the norm this morning and I think I have a demo library ready. (20 mb)
I would rather let a willing guinea pig or two have a look before generally releasing it.
I would like to get live feedback too if possible, so, if you're
  • using MC v12.0.102
  • interested
  • not afraid
  • and
  • using live messenger
drop me a line using msn-at-theganghut.co.uk
Include your messenger contact info and possible time window.
-marko.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: building an image library. (work in progress)
« Reply #38 on: January 06, 2007, 08:14:45 am »

marko;

Using 'Replace Master', do you have to manually increment the filename number for each file? Or did you do something with renaming from track # first and then use RM?

I'm thinking of filling all images' track # from order in list, rename files with track #, then use RM to prepend the 3-letter key and appropriate no. of zeroes.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: building an image library. (work in progress)
« Reply #39 on: January 06, 2007, 08:39:21 am »

Another question, marko; how do you deal with new images from your Ixus which have the same filenames as images in your library already? Or, how do you get around duplicate filenames in version sets?

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #40 on: January 07, 2007, 07:59:49 am »

marko;

Using 'Replace Master', do you have to manually increment the filename number for each file? Or did you do something with renaming from track # first and then use RM?

I'm thinking of filling all images' track # from order in list, rename files with track #, then use RM to prepend the 3-letter key and appropriate no. of zeroes.
KingSparta made this very simple to do, but has since pulled this plugin from his site, citing "unexpected behaviour" and "more work needed" and "may return later" so use at own risk. FWIW, I've had absolutely no problems using it for renaming the [filename] fields, and continue to use it.

I use Google's "Hello" software to share photos with my Mum. MC12 auto imports these files, and as you might guess, the filenames are completely unpredictable, [source] in this case is determined from the [file name (path)] field. I send these pictures to playing now and load up Replace Master...

Click Replace Master's 'Settings' tab and set it up as shown below. I use the file name template "[source identifier]_[file count]" and the [file count] is padded to 4 figures. I already know that the file count for Mum's photos is up to 0195, so I set replace master to start at 196.

Now switch to the Replace Master tab, and set it up as shown below. The six hashes tell Replace Master to use the incremental settings.

See the 'Preview' field above to check the result will be as desired, and click on the "Do It" button. In a matter of seconds, the file names are all sorted.

I will now tag these files and then finally, use the rename files from properties tool to move them to their final, permanent resting place on my hard drive.

Another question, marko; how do you deal with new images from your Ixus which have the same filenames as images in your library already? Or, how do you get around duplicate filenames in version sets?
The Ixus creates files named IMG_0001, IMG_0002, IMG_0003, etc. etc. so, as I've not reached IMG_9999 yet, I don't get duplicate filenames from the Ixus. As 99% of new images come from the Ixus, I used its filename template for the rest of my images.
IMG_xxxx = Camera
MUM_xxxx = Mum
WAL_xxxx = wallpaper images
CLP_xxxx = clipart
SCN_xxxx = scanned images
etc. etc.
So, I do not need to worry about renaming the photos that come from the Ixus.
Version sets are derived from these filenames. Having set up a calculated field that is populated by the first eight characters of the filename, IMG_0001.jpg and IMG_0001_edited-1.jpg both have the same [version set] value. Again, thanks to Dlone's batch file prowess, I can right click on IMG_0001 and send it to a batch file that creates a copy of IMG_0001 called IMG_0001_edited-1, and then opens that copy in photoshop. By the time I've finished editing the photo, MC's auto import has detected and imported the new file, and as I've set all image related tags to be saved in the file, the tags in the new copy match the original, and when I hit the save button in photoshop, MC picks that up too and updates the thumbnail.
All that remains to do then is to set the original files' [top image] field to 'no' which will exclude it from view in the main photo browsing viewscheme.
I hope that helps a bit, I'm not exactly what you might call the best wordsmith in the world!!

I've been re-writing things 'offline' here and had planned to repost it in the MC12 forums because really, without the auto import feature, it's a bit too much work. I'll lock this thread when that happens.

-marko.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: building an image library. (work in progress)
« Reply #41 on: January 07, 2007, 09:42:21 am »

Thanks for that, marko - a clear explanation, as usual. You're a better wordsmith than you give yourself credit for!  :)

Does your Ixus actually track the filenames it has generated in the past, and then increment them by one every time you take a photo? Mine seems to generate its filenames based on the existing names on the camera, so if there are no images on the camera, the first photo I take gets the name 'IMG_0001'.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8959
Re: building an image library. (work in progress)
« Reply #42 on: January 07, 2007, 11:28:48 am »

Quote
Does your Ixus actually track the filenames it has generated in the past, and then increment them by one every time you take a photo?
Yes. The camera's options menu has a file No. reset option that I have switched to 'off'

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: building an image library. (work in progress)
« Reply #43 on: January 07, 2007, 03:11:17 pm »

The camera's options menu has a file No. reset option that I have switched to 'off'
As does mine, it turns out! Dammit, wish I'd known about that before! I've had the thing for years!

 ::)
Pages: [1]   Go Up