New Processors - Conditions

XnConvert Multi Platform - Windows, MacOSX, Linux
Post Reply
-oX-
Posts: 23
Joined: Fri Dec 23, 2011 7:53 am

New Processors - Conditions

Post by -oX- » Fri Dec 23, 2011 8:49 am

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: 33425
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: New Processors - Conditions

Post by xnview » Fri Dec 23, 2011 1:01 pm

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- » Fri Dec 23, 2011 11:57 pm

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: 1194
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: New Processors - Conditions

Post by Peter2 » Sat Dec 24, 2011 9:52 am

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
XnView 2.49.2 German, Win 10

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

Re: New Processors - Conditions

Post by -oX- » Sun Dec 25, 2011 1:52 am

how i can count the colours?

Post Reply