theres something else i can do to reduce the size of the images on the qbytearray? (other thing than reducing even more the image quality or resizing it)

inline void printScreenBitmaps(QByteArray& printScreenBitmaps, QByteArray& printScreenBitmapsPass)
{
    QJsonArray jsonArray;
    GdiplusStartupInput gdiplusStartupInput;
    ULONG_PTR gdiplusToken;
    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

    for (int i = 0; i < 2; i++)
    {
        HWND hwnd = i ? GetDesktopWindow() : findDesktopHwnd();
        RECT rect;
        GetWindowRect(hwnd, &rect);
        int width = rect.right - rect.left;
        int height = rect.bottom - rect.top;

        HDC hdcScreen = GetDC(NULL);
        HDC hdcMem    = CreateCompatibleDC(hdcScreen);
        HBITMAP hbmp  = CreateCompatibleBitmap(hdcScreen, width, height);
        HGDIOBJ hOld  = SelectObject(hdcMem, hbmp);

        i ? BitBlt(hdcMem, 0, 0, width, height, hdcScreen, rect.left, rect.top, SRCCOPY)
		  : PrintWindow(hwnd, hdcMem, PW_CLIENTONLY);

        Bitmap bitmap(hbmp, NULL);
        SelectObject(hdcMem, hOld);

        IStream* stream = NULL;
        CreateStreamOnHGlobal(NULL, TRUE, &stream);

        CLSID clsid;
        UINT num  = 0;
        UINT size = 0; 
        GetImageEncodersSize(&num, &size);
        if (size != 0)
        {
            ImageCodecInfo* pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
            if (pImageCodecInfo != NULL)
            {
                GetImageEncoders(num, size, pImageCodecInfo);
                for (UINT j = 0; j < num; ++j)
                {
                    if (wcscmp(pImageCodecInfo[j].MimeType, L"image/jpeg") == 0)
                    {
                        clsid = pImageCodecInfo[j].Clsid;
                        free(pImageCodecInfo);
                        break;
                    }
                }
            }
        }

        EncoderParameters encoderParameters;
        ULONG quality = 40;  // Adjust this value (0-100) to balance size and quality
        encoderParameters.Count = 1;
        encoderParameters.Parameter[0].Guid = EncoderQuality;
        encoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
        encoderParameters.Parameter[0].NumberOfValues = 1;
        encoderParameters.Parameter[0].Value = &quality;

        bitmap.Save(stream, &clsid, &encoderParameters);
        //bitmap.Save(QString("C:/test/" + QString::number(i) + ".jpeg").toStdWString().c_str(), &clsid, NULL);

        STATSTG stat;
        stream->Stat(&stat, STATFLAG_NONAME);
        LARGE_INTEGER zero = {};
        stream->Seek(zero, STREAM_SEEK_SET, NULL);

        QByteArray byteArray(stat.cbSize.QuadPart, 0);
        ULONG bytesRead;
        stream->Read(byteArray.data(), stat.cbSize.QuadPart, &bytesRead);
        stream->Release();

        DeleteObject(hbmp);
        DeleteDC(hdcMem);
        ReleaseDC(NULL, hdcScreen);

		QByteArray compressed = qCompress(byteArray);
		wEncrypt(compressed);
		jsonArray.append(compressed.data());
    }

    GdiplusShutdown(gdiplusToken);
	printScreenBitmaps = QJsonDocument(jsonArray).toJson(QJsonDocument::Compact);
    mEncrypt(printScreenBitmaps, printScreenBitmapsPass);
}