Announcement

Collapse
No announcement yet.

scripting Batch coversion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Requested scripting Batch coversion

    organize, sort, combine everyway, scripting Batch coversion

    hello,
    The majority of simple operations could hand out much improvement by adding some sort of possibility to combine, or rather to add various possibilities of combination methods. But not all possible means to manipulate an image are ready to hand, off course. I especially treat the crop and resize options, but similar conversion systems could be made for color changes,...

    an idea could be that the form would be arranged differently in columns:
    operation (crophorizontallytop, crophorizontallybottom, cropverticallyleft, cropverticallyleft, resize) // user value // value type (%, px, cm, inch) // condition (... make it possible to add expressions...)
    this would force the user to make only one operation a time, so storing settings is not so usefull anymore. This does not really mend matters...

    A better idea is to design a scripting language. In one fell swoop you open a tremendous range of opportunitys to the user. The trick is to make it easy to understand to the layman of scripting...
    This example (theoretical) script would turn the original long side of the picture up (vertically) and crop the picture into a square. When the picture has a long side that is a fourth (or more than a fourth part) more than the size of the short side, it will crop unequally at the top (0,3*var) and at the bottom (0,2*var) (always the long direction because of the previous turn). When the long side is less than a fourth of the short one, the cropping works out taking away the same amount at the top (var/2) and the bottom (var/2).

    Code:
    if longside >= 1,25*shortside
    	{
    	gethorizontalstate (longside; "horizontalvariable")
    	if horizontalvariable=1
    		{
    		flip (clockwise; 90°)
    		}
    	longside-shortside="var"
    	cropY (0,3*var; 0,2*var)
    	end
    	}
    else
    	{
    	longside-shortside="var"
    	if var=0
    		{end}
    	else
    		{
    		gethorizontalstate (longside; "horizontalvariable")
    		if horizontalvariable=1
    			{
    			flip (clockwise; 90°)
    			}
    		cropY (var/2; var/2)
    		}
    	end
    	}

    if the long side is a fourth (or more than a fourth part) more than the size of the short side,
    when the long side is horizontal, horizontalvariable will have the value 1
    if 1, flip the image/ if 0, nothing happens
    the difference of the long side and the short side is stored in "var"
    this will command to crop the image: cropY (amount to crop at the top; amount to crop at the bottom)
    end should empty the variables, rerun the script on the next image or leave when done.

    else if the long side is NOT a fourth (or more than a fourth part) more than the size of the short side,
    the difference of the long side and the short side is stored in "var"
    when the image is already a square, the scripting language default could choose the vertical side as the long side, but it would end here
    if horizontalvariable is 1, flip the image/ if 0, nothing happens
    crop the image in equal proportions at the top (var/2) and the bottom (var/2)
    ends.

    other automated seletion modification examples

    to make thubs:turn longest side vertical, resize (with or without limitations), display a retangle round the mouse and let the user see the image and choose the position by clicking.
    detect the global brightness of each image, compared with the quantity of pixels that are in heavy contrast, make the image's brightnesses and contrasts similar.

    set a maximum file size, and compression factor & file type limitations and other settings?


    so, this were ideas that would probebly take enormous efforts to put into practice, but I think it would gain an extra star, up to the fifth version! ok it is not my place to say that. Suggestions, additions, about organizing the future Batch conversion techniques, or just comments are welcome!

    with kindest regards, Bart
    (pff I dont wreally speak English fluently)
    Last edited by sharethewisdom; 27.07.2008, 07:26 PM. Reason: image examples added

    #2
    Hi Bart,

    If I understand you well, your request is IrfanView to be able to execute scripts... Many things can be done from the command line. Of course, such a special processing as the one you describe isn't possible. But do you really need this? In this case, you could try combining IrfanView with a scripting tool like AutoIt.

    Laurent
    Before you post ... fill in your OS and IV version in your profile.

    Comment


      #3
      I think users firstly wreally need a proper way of selecting the right images/files.

      here are several automated scripts with autohotkey but I don't think Irfanvieuw has enough "command-possibilities": that way you better script using only autohotkey (or autoIt,..)
      The example above is a bit far-fetched and boring, I admit, but there are simple conversions that takes an enormous manual effort when working with a huge amount of images (or music files), I don't think every Irfan user wildly enthusiastic about learning an other scripting language in which these 'commands' (reading the average brightness, contrast, ..) are very complex. They could be rendered into simple words, building up a specialized scripting language.
      However, I 'm not informed about the possibilities of advanced fotoshop-like programs, the possibility of plugging-in, interchangeable potential,... in regard of Batch conversion

      I havn't met a Batch conversion program that can select files by means of custom criteria yet.
      Last edited by sharethewisdom; 28.07.2008, 06:25 PM.

      Comment

      Working...
      X