Boost logo

Boost :

Subject: Re: [boost] Review request: gil::io
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-05-26 11:30:52


>
> I frequently have to process batches of video frames that often have non sq.
> pixels ; I'd be frustated to have a lossy PNG loader in GIL.
>
> I don't think that silently rescaling an image with nonsquare pixels is good
> practice. A nonsquare pixel is still a pixel. Imagine that you want to apply
> a filter to a non sq. pix. PNG file, if GIL silently changes the image size,
> there's no way for you to get back the original image size and pixels. Not
> to mention that depending on the image type you may want to use different
> filter kernels to do the resize.
>
> IMHO the best solution would be to simply provide a way to know the pixel
> aspect ratio, and let users of the lib handle it the way they want, i.e.
> rescale or not or whatever.

I can only agree here. Gil makes it very easy to create a new image
type based on a pixel type. When reading non-sq pixels I would suggest
to create a new pixel type containing the pixel's aspect ratio.
Perhaps, we can even have such information in a image_view type.

As for the io extension I would try to refrain from any post
processing as much as possible, especially when using read_image( ...
).

Regards,
Christian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk