A few moments ago, Scott Rossi <[EMAIL PROTECTED]> wrote:
> Recently, [EMAIL PROTECTED]  wrote:
> 
>> Imagine a jpg or png image (any format really) that has white space all
>> around the image. What would be the most efficient way to sample the
>> colors (quickly) and determine a rect that can be used to crop the 
image?
>> Has this been done before? Got scripts?
> 
> If you could guarantee that that the space around the image was *truly*
> white (or some other solid color) and the images were not huge then this
> *might* be possible to some extent.  However, many images, most notably
> JPEGs, can have color variations in the white space due to compression,
> which makes this a tough thing for Rev to do natively if you want it 
done fast.

Determining if a pixel is 'lighter than' some value would be ok. It 
doesn't have to be absolute white. The goal is to present the user with an 
adjustable crop box that has already positioned itself 'close' to the 
desired crop rect.

> The other issue is, if the white space is irregular, then you
> basically need to sample virtually every point around image, looking for
> non-white-space color changes.  Again, I might be wrong but I think this
> would be hard to do natively if it needs to be fast.

These images are huge. What I envision is a method that would 'look at' 
every 10th or 20th pixel as it loops through the image (for improved 
speed). In most cases, it would still achieve a rect that represents the 
boundaries of the image. The user would then make slight manual 
adjustments to the crop box.

> I know Chipp Walters of Altuit was working with some kind of 
Photoshop-like
> algorithms or libraries -- maybe he has some insight.

I hope he releases altCropMagic (in the style of his other wonderful 
stacks)!  ;-)   Come on Chipp!!!

> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design

Kind regards,
Roger Eller <[EMAIL PROTECTED]>

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to