Re: [Imtoolkit-users] Convert loaded gif file
Brought to you by:
scuri
From: Antonio S. <sc...@te...> - 2014-07-18 23:55:10
|
The image in the GIF file is not an RGB image. So it loaded a im.MAP image. That's why the resize failed. So there are a few ways to make it work. -- assume the image is map r_img = im.ImageCreate(r_w, r_h, im.MAP, im.BYTE) -- create a new image based on the old one r_img = im.ImageCreateBased(image, r_w, r_h, nil, nil) -- let the ResizeNew do it all r_img = im.ProcessResizeNew(image, r_w, r_h, order) But it would be better to user the write interpolation order. im.MAP images can not be linear interpolated. order = 1 if (image:ColorSpace() == im.MAP or image:ColorSpace() == im.BINARY) then order = 0 end Best, Scuri On Fri, Jul 18, 2014 at 2:47 PM, Milind Gupta <mil...@gm...> wrote: > Hi, > I am loading a gif file using image = > im.FileImageLoadBitmap(fileName) then I want to resize this loaded file so > I tried: > r_img = im.ImageCreate(r_w, r_h, im.RGB, im.BYTE) > im.ProcessResize(image, r_img, 1) -- do bilinear interpolation > > But I get this error: > images must have the same data type and color space > stack traceback: > [C]: in function 'ProcessResize' > bingo.lua:50: in function 'resizeImage' > bingo.lua:81: in function 'SavePalettes' > bingo.lua:103: in main chunk > [C]: ? > > How can I do the appropriate conversion so that the resize works. > > Thanks, > Milind > > > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users > > |