darzanmihai Posted November 2, 2009 Share Posted November 2, 2009 (edited) How could I shrink a .bmp file from autoit, without using external executables? (for example from 900kb to 100 kb or less) Thx in advance. Edited November 2, 2009 by darzanmihai I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
Bert Posted November 2, 2009 Share Posted November 2, 2009 http://malektips.com/file_extensions_0017.html The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
evilertoaster Posted November 2, 2009 Share Posted November 2, 2009 (edited) Incidentally, I did make a native 'wrapper' for Bitmaps which i recently updated- http://www.autoitscript.com/forum/index.php?showtopic=27362. It does not provide a built in 'resize' function (if that's what you're after?), but it does give you functions to deal with the bitmap at the pixel level so you could implement any number of things to try and reduce the data size. However, if you're looking at just reducing the file size, maybe you want to compress it with a standard file compressor instead? Edited November 2, 2009 by evilertoaster Link to comment Share on other sites More sharing options...
Authenticity Posted November 2, 2009 Share Posted November 2, 2009 Look at _ScreenCapture_SaveImage() function definition and see how to set a JPG file's quality. You can save .bmp as .jpg and reduce it's quality, thus reducing it's size on disk. Link to comment Share on other sites More sharing options...
darzanmihai Posted November 3, 2009 Author Share Posted November 3, 2009 Incidentally, I did make a native 'wrapper' for Bitmaps which i recently updated- http://www.autoitscript.com/forum/index.php?showtopic=27362. It does not provide a built in 'resize' function (if that's what you're after?), but it does give you functions to deal with the bitmap at the pixel level so you could implement any number of things to try and reduce the data size.However, if you're looking at just reducing the file size, maybe you want to compress it with a standard file compressor instead?Very interesting functions. You could use it to create filters for images. Thx for sharing. I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
darzanmihai Posted November 3, 2009 Author Share Posted November 3, 2009 Look at _ScreenCapture_SaveImage() function definition and see how to set a JPG file's quality. You can save .bmp as .jpg and reduce it's quality, thus reducing it's size on disk.I looked at it...it would be a realy good ideea, but I can't figure out how to use it to open a .bmp and get it's handle, set the image quality and save it as .jpg.How could I open it and get the handle to use with the ScreenCapture functions?Thx I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
Authenticity Posted November 3, 2009 Share Posted November 3, 2009 #include <ScreenCapture.au3> Local const $sFileBMP = @ScriptDir & "\Desktop.bmp" Local Const $sFileJPG = @ScriptDir & "\Desktop.jpg" _ScreenCapture_Capture($sFileBMP, 0, 0, -1, -1, False) _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sFileBMP) _GDIPlus_ImageSaveToFile($hImage, $sFileJPG) _GDIPlus_Shutdown() You can then look in _ScreenCapture_SaveImage() to see how to play with the quality of the image, if it makes different. 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