def _image_encoder(ffcv_parameters: "FFCVParameters"):
    """
    Create a :class:`RGBImageField` given additional
    parameters passed by the user. Follows the FFCV defaults.

    :param ffcv_parameters: The additional parameters passed
        to the :func:`enable_ffcv` function.
    :return: A :class:`RGBImageField` instance.
    """
    from ffcv.fields import RGBImageField

    return RGBImageField(
        write_mode=ffcv_parameters.get("write_mode", "raw"),
        max_resolution=ffcv_parameters.get("max_resolution", None),
        smart_threshold=ffcv_parameters.get("smart_threshold", None),
        jpeg_quality=ffcv_parameters.get("jpeg_quality", 90),
        compress_probability=ffcv_parameters.get("compress_probability", 0.5),
    )

    Create a :class:`RGBImageField` given additional
    parameters passed by the user. Follows the FFCV defaults.

    :param ffcv_parameters: The additional parameters passed
        to the :func:`enable_ffcv` function.
    :return: A :class:`RGBImageField` instance.
    
avalanche/benchmarks/utils/ffcv_support/ffcv_support_internals.py