New Processors - Conditions

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

-oX-
Posts: 23
Joined: Fri Dec 23, 2011 7:53 am

New Processors - Conditions

Post by -oX- »

Its possible to add a new processor-category "conditions"
i think on If/then/else batchs
with Count Colour / Filesize and so on
this would make your converter to the only app is more then batch ;-)

tnx
User avatar
xnview
Author of XnView
Posts: 44916
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: New Processors - Conditions

Post by xnview »

Could you post examples of use?
Pierre.
-oX-
Posts: 23
Joined: Fri Dec 23, 2011 7:53 am

Re: New Processors - Conditions

Post by -oX- »

if image().x > image()y
then image().rotate(90)


or

do while image().save.filesize > 10000
i=-0.1
image().resize(i)
end

or

select image().countcolour
> 10.000 then image().posterize(256)
> 1.000 then image().posterize(64)
> 100 then image().posterize(16)
end
User avatar
Peter2
XnThusiast
Posts: 1350
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: New Processors - Conditions

Post by Peter2 »

Hello -oX-

your suggestion sounds fine, but I always bear in mind: Where are the limits of these "conditions"?

Image size: in Pixel or Point or Inch or cm? Absolute ("length greater then width"; "length greater then 110% of width"; "length greater then width+20 px")
File size: Reduce to 50% of file size; reduce to 50% of image width; reduce to fixed image width, reduce to fixed file size, ...

This becomes not easy to develop and not easy to use in form of conditions.

A solution without conditions could be:
- Use an intermediate step to search and filter the files you need (e.g. with a file manager or with the filters in XnView)
- then run a defined conversion with a defined batch of file

That sounds unhandy and not-state-of-the-art, but you are absolutely free with your filter-and-search-definitions.

Peter
XnViewMP <Current version> German, XnConvert <Current version>, Win 10
-oX-
Posts: 23
Joined: Fri Dec 23, 2011 7:53 am

Re: New Processors - Conditions

Post by -oX- »

how i can count the colours?