Reduce Opencv framework size on iOS

I want to use OpenCV on an SDK I developing. The main usage is to use it to resize UIImage, and this is the code I’m using for that(everything works fine):

#import <opencv2/opencv.hpp>
#include <opencv2/imgcodecs/ios.h>

+(UIImage*)resizeImage:(UIImage *)image toSize:(CGSize)size {
    cv::Mat cvImage;
    cv::Mat dest;
    UIImageToMat(image, cvImage);

    cv::resize(cvImage, dest, cv::Size(size.width,size.height), cv::INTER_CUBIC);
    UIImage* newSize = MatToUIImage(dest);


    return newSize;

To compile the OpenCV I’m using this command line:

python3.9 platforms/apple/ ios --out somedir --legacy_build --disable_swift_build --iphoneos_archs arm64 --iphonesimulator_archs x86_64 --build_only_specified_archs --without video --without dnn --without videoio --without objdetect --without calib3d --without flann --without highgui --without features2d --without photo --without gapi --without ml --without stitching

It makes me an output xcframework with a size of: 51.6 MB. Then I add this xcframework to my SDK and use the code above to resize the photo.

When I try to create an xcframework from my SDK it increases the size from 11.3mb(before OpenCV was added) to 17.9(after the open cv was added).

Then I want to add the SDK to a sample project that I use to test it, and the size on App Store Connect(I checked under the TestFlight tab - Compressed File Size) was increased from 8.76 MB to 10MB.

Any idea how I can decrease the OpenCV framework more than that? i remove every module that I don’t need and still the same results.