Ashalshaikh Posted June 7, 2009 Share Posted June 7, 2009 Good Work Thank You Link to comment Share on other sites More sharing options...
Zedna Posted November 11, 2009 Share Posted November 11, 2009 VERY NICE!! Thanks for all your work and sharing it ProgAndy. Five stars from me. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Hellooopsforgotsendcommand Posted November 25, 2009 Share Posted November 25, 2009 VERY NICE!! Thanks for all your work and sharing it ProgAndy.Five stars from me.Does free image support image tagging? Link to comment Share on other sites More sharing options...
ProgAndy Posted November 25, 2009 Author Share Posted November 25, 2009 Does free image support image tagging?Yes. The functions to manipulate them are descripbed in the helpfile under the topic "Metadata function reference". Thres also some description for the different formats ("FreeImage metadata models"). *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
WalkHappy Posted December 19, 2009 Share Posted December 19, 2009 I need help converting an image to greyscale #include <FreeImage.au3> $pDIB = "image01.bmp" _FreeImage_ConvertToGreyscale($pDIB) This code doesn't seem to do anything Link to comment Share on other sites More sharing options...
WalkHappy Posted December 19, 2009 Share Posted December 19, 2009 I need help converting an image to greyscale #include <FreeImage.au3> $pDIB = "image01.bmp" _FreeImage_ConvertToGreyscale($pDIB) This code doesn't seem to do anything oh sorry i totally forgot the _FreeImage_SaveU _FreeImage_Unload Ill come back with future questions Link to comment Share on other sites More sharing options...
WalkHappy Posted December 21, 2009 Share Posted December 21, 2009 (edited) I'm not sure which function I should use to remove colors?Converting to blackandwhite was super easy but I need something that could alter the image moreI was taking a look at these two functions :FreeImage_SetTransparentFreeImage_CompositeCould anyone explain exactly what these do? Or please give some examples?If you've ever used photoshop, this is what I'm trying to editThanks, Edited December 21, 2009 by WalkHappy Link to comment Share on other sites More sharing options...
ProgAndy Posted December 21, 2009 Author Share Posted December 21, 2009 Hello, I do not really know, what FreeImage_SetTransparent is for. Maybe it is for manipualting GIF/PNG or something like that. With FreeImage_Composite You can copy an image with transparent parts on an other image or a single colored background. To create something like this dialog in Photoshop, you have to get the Bitmap-Bits and convert them on your own i think. Then you can set them back. Or maybe a combination of FreeImage_Dither or FreeImage_Threshold with the FreeImage_Adjust...-functions will give you the expected result. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
WalkHappy Posted December 21, 2009 Share Posted December 21, 2009 Hello,I do not really know, what FreeImage_SetTransparent is for. Maybe it is for manipualting GIF/PNG or something like that.With FreeImage_Composite You can copy an image with transparent parts on an other image or a single colored background.To create something like this dialog in Photoshop, you have to get the Bitmap-Bits and convert them on your own i think. Then you can set them back. Or maybe a combination of FreeImage_Dither or FreeImage_Threshold with the FreeImage_Adjust...-functions will give you the expected result.Thank you thank you Ive been stuck on this for hours.. hopefully it wont lead into days lolI'll return with results Link to comment Share on other sites More sharing options...
obrienj Posted January 26, 2010 Share Posted January 26, 2010 ProgAndy, Nice piece of work but as I am not an image specialist, could you help with a little problem that I think FreeImage can help with. I have 4 images, one jpeg (call it the base image) and 3 transparent gif images. I would like to combine the 4 into one by placing all of the gif images over the jpeg and creating a single combined file. Can FreeImage do this, and if so, could you help a poor old (literally) programmer with an AutoIt example of how to do it. Regards, Jim Link to comment Share on other sites More sharing options...
ProgAndy Posted January 27, 2010 Author Share Posted January 27, 2010 ProgAndy, Nice piece of work but as I am not an image specialist, could you help with a little problem that I think FreeImage can help with. I have 4 images, one jpeg (call it the base image) and 3 transparent gif images. I would like to combine the 4 into one by placing all of the gif images over the jpeg and creating a single combined file. Can FreeImage do this, and if so, could you help a poor old (literally) programmer with an AutoIt example of how to do it. Regards, Jim You can do this with FreeImage, but it would be easier with GDIplus. FreeImage forces you to care about Bit-depth and palettes, GDIPlus doesn't. Anyways, this code should work: $hMainImage = _FreeImage_LoadU($FIF_JPEG, "C:\TheJPEG.jpg", 0) $hMainImage32bit = _FreeImage_ConvertTo32Bits($hMainImage) _FreeImage_Unload($hMainImage) ; we have the copy in 32bits $hGIFImage = _FreeImage_LoadU($FIF_GIF, "C:\aGIF.gif", 0) $hGIFImage32bit = _FreeImage_ConvertTo32Bits($hMainImage) _FreeImage_Unload($hGIFImage) ; we have the copy in 32bits $iX = 12 $iX = 34 ; both images have to be in same format, this is why they were converted. _FreeImage_Paste($hMainImage32bit, $hGIFImage32bit, $iX, $iY, 300) ; last parameter > 255 for combiing without custom transpareny _FreeImage_Unload($hGIFImage32bit) ; now drawn, not needed anymore _FreeImage_SaveU($FIF_JPEG, $hMainImage32bit, "C:\Combined.jpg", 0) _FreeImage_Unload($hMainImage32bit) ; we saved it, not needed anymore LukeLe 1 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
nuki Posted February 3, 2010 Share Posted February 3, 2010 (edited) hey thanks for the great udf but im somehow too dumb to convert a .tga to a .bmp or .bmp to .tga.. is there some kind of convert command that i have missed? i took your first example as base and tried _FreeImage_ConvertTo32Bits too, but i dont know exactly how to tell the program to convert just load the .tga and save it as .bmp doesnt seem to work either, it says the bitmap is empty or corrupted thanks for any help greets nuki edit: this is my code: #include <FreeImage.au3> _FreeImage_LoadDLL(@ScriptDir&"\FreeImage.dll") _FreeImage_Initialise() $sFile = "test.tga" $FIF = _FreeImage_GetFileTypeU($sFile) If $FIF = $FIF_UNKNOWN Then $FIF = _FreeImage_GetFIFFromFilenameU($sFile) EndIf $hImage = _FreeImage_LoadU($FIF, $sFile) $dot = StringInStr($sFile,".",1,-1) $Name = StringLeft($sFile,$dot-1) ;that one below was wrong ;_FreeImage_SaveU($FIF, $hImage, $Name &"_rsz.bmp") ;0 is the FIF code for BMP, 17 for TGA _FreeImage_SaveU(0, $hImage, $Name &"_rsz.bmp") _FreeImage_Unload($hImage) _FreeImage_DeInitialise() damn sorry for disturbing, i got it after reading the documentary a 2nd time... its too late already im in bed... the solution for makin it work is commented thanks again for the great udf, helps me alot! edit2: whats wrong with that? autoit crashes. $return[0] returns a valid handle. $return = DllCall("FreeImage.dll", "ptr", "_FreeImage_LoadU@12", "long", "17", "wstr", "test.tga", "int", "0") DllCall("FreeImage.dll", "int", "_FreeImage_SaveU@16", "long", "0", "ptr", $return[0], "wstr", "test2.bmp", "int", "0") thanks for answers, i go to bed now edit3: couldnt sleep cuz of it xD solved now $open = DllOpen("FreeImage.dll") $return = DllCall($open, "ptr", "_FreeImage_LoadU@12", "long", "17", "wstr", "test.tga", "int", "0") DllCall($open, "int", "_FreeImage_SaveU@16", "long", "0", "ptr", $return[0], "wstr", "test2.bmp", "int", "0") DllClose($open) finally good night greets Edited February 3, 2010 by nuki Link to comment Share on other sites More sharing options...
myspacee Posted February 8, 2010 Share Posted February 8, 2010 (edited) Hello, start to read documentation (huge, and very well done) But can't find simple example to how : - open file (png) - resize - save to different format (jpg) I've directory with many .png, must resize them and save as .jpg. Can anyone help me to start using this little gem ? Thank you all for reading, m. Edited February 8, 2010 by myspacee Link to comment Share on other sites More sharing options...
ProgAndy Posted February 8, 2010 Author Share Posted February 8, 2010 (edited) Hello, start to read documentation (huge, and very well done) But can't find simple example to how : - open file (png) - resize - save to different format (jpg) I've directory with many .png, must resize them and save as .jpg. Can anyone help me to start using this little gem ? Thank you all for reading, m. There is already an example in the first post The only thing you have to change is this: $Ext = StringMid($sFile,$dot) _FreeImage_SaveU($FIF, $hImageResized, $Name &"_rsz"&$Ext) To use JPEG here, you have to do this: $Ext = '.jpeg' _FreeImage_SaveU($FIF_JPEG, $hImageResized, $Name &"_rsz"&$Ext) Edited February 8, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
masc Posted February 28, 2010 Share Posted February 28, 2010 There is already an example in the first post ... To use JPEG here, you have to do this: $Ext = '.jpeg' _FreeImage_SaveU($FIF_JPEG, $hImageResized, $Name &"_rsz"&$Ext) Hi ProgAndy, I tried your code but all i get is a zero byte jpg image. Thats the 2 lines I changed in your example from your first post: $sFile = "test.tga" ... _FreeImage_SaveU($FIF_JPEG, $hImageResized, $Name &"_rsz.jpg") I also tried bmp as an input file but the result was the same. However it works if I convert the targa file into a bmp! Any help would be highly appreciated. Have Fun masc Link to comment Share on other sites More sharing options...
ProgAndy Posted February 28, 2010 Author Share Posted February 28, 2010 Sorry, I am not a master of FreeImage. I think you have to convert the image to 24bit or 8bit greyscale to use FIF_JPEG. It does not convert automatically. Note that some bitmap save plugins have restrictions on the bitmap types theycan save. For example, the JPEG plugin can only save 24 bit and 8 bit greyscale bitmaps *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
masc Posted February 28, 2010 Share Posted February 28, 2010 Sorry, I am not a master of FreeImage. I think you have to convert the image to 24bit or 8bit greyscale to use FIF_JPEG. It does not convert automatically.Thanks for the hint, I will try that. Link to comment Share on other sites More sharing options...
masc Posted March 2, 2010 Share Posted March 2, 2010 Thanks for the hint, I will try that.Worked fine. Thanks. Link to comment Share on other sites More sharing options...
Collus Posted March 16, 2010 Share Posted March 16, 2010 Great job! Thank you ,ProgAndy. I need this UDF NOW ,but the link give wrong address, i can not download it, please check ,thanks Link to comment Share on other sites More sharing options...
ProgAndy Posted March 16, 2010 Author Share Posted March 16, 2010 The download works fine (here). Which browser do you use? *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now