smbape Posted January 28, 2022 Author Share Posted January 28, 2022 (edited) Hi @memerim On 1/27/2022 at 3:47 AM, memerim said: Do you know how to convert a opencv image to a gdi hbitmap Local $img = $cv.imread("path image") Local $hBitmap = $img.convertToBitmap() On 1/27/2022 at 3:47 AM, memerim said: would takes lesss size on RAM or at the end would be the same thing as using by default a bitmap>hbitmap using just GDI? Probably more, depending on the color conversion and it is the same thing as converting bitmap to hbitmap. On 1/27/2022 at 3:47 AM, memerim said: I'm storing some hbitmaps in memory but they are using too much RAM, i wonder ifs possible somehow do any kind of compression on them converting opencv > hbitmap? You did not give what you call too much RAM. I assume your image is big ( > 100MB), if not, then you probably have a memory leak somewhere. When using GDI+ with AutoIt, beware of memory leaks. There are multiple ways to reduce memory usage, at the price of less accurate results. Some ways are: Resize the image Read the image in grascale Threshold the image (may be canny) Blur the image You have to test those ways to see what combination gives the best results. Edited January 28, 2022 by smbape Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now