Yes, Dariusz is probably right and the function that does this is 
ImageBufAlgo::resample().
The resample function is very similar to resize, except it just bilinearly 
samples between the nearest 4 input pixels, for each output pixel (whereas a 
true resize will filter over the whole input region corresponding to the output 
pixel).

The resample is lower quality than the resize, but for just generating a quick 
preview thumbnail, it may be just fine.

        -- lg


> On Jun 29, 2022, at 2:17 AM, Dariusz <[email protected]> wrote:
> 
> Hey
> 
> Tinkering with the same issue...
> 
> I think a faster way would be to get width & height, figure out every nth 
> pixel that you want depending on the resolution that you with to get & then 
> read only these bytes from arrays.
> 
> It wont smooth/resample pixels/etc but u can get quick rough thumbnail this 
> way I think?
> 
> Regards
> Dariusz
> 
> On 28/06/2022 10:22, ████刮 wrote:
>> Hi. may i ask is there a fast way to generate thumbnail image?
>> i have many image with different resolution(from 1080P to 8K or 16K) and 
>> different format(jpg, png, exr, psd...etc)
>> there is a existed thumbnail image in Psd format i can use. but for another 
>> format i must generate by myself.
>> 
>> here is what i was tried:
>> load image with ImageBuf class. then use ImageBufAlgo::resize or resample 
>> function to scale it to the target resolution(maybe 480x270). then save the 
>> thumbnail image to Disk file.
>> it was worked. 
>> 
>> i just interesting that is there a "better" or "faster" way to do this? 
>> especially for large image.
>> 
>> Thanks!
>> 
>>      
>> ████刮
>> [email protected]
>>  
>> <https://wx.mail.qq.com/home/index?t=readmail_businesscard_midpage&nocheck=true&name=%E2%96%88%E2%96%88%E2%96%88%E2%96%88%E5%88%AE&icon=https%3A%2F%2Fres.mail.qq.com%2Fzh_CN%2Fhtmledition%2Fimages%2Frss%2Fmale.gif%3Frand%3D1617349242&mail=15952002677%40qq.com&code=>
>>  
>> 
>> 
>> _______________________________________________
>> Oiio-dev mailing list
>> [email protected] <mailto:[email protected]>
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org 
>> <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
> 
> -- 
> DARIUSZ MAKOWSKi
> CGI-Photographer
> 07 590 530 854
> [email protected] <mailto:[email protected]>
> www.dariuszmakowski.com <http://www.dariuszmakowski.com/>
> 
>  
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>     Virus-free. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>  
> <x-msg://20/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>_______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]





_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to