def _reduce_qr_code_density(image: QImage) -> QImage:
    """ Reduces the size of the qr code relative to the whole image. """
    new_image = QImage(image.width(), image.height(), QImage.Format.Format_RGB32)
    new_image.fill(QColor(255, 255, 255))  # Fill white

    painter = QPainter(new_image)
    source_rect = QRect(0, 0, image.width(), image.height())
    target_rect = QRect(0, 0, int(image.width() * 0.75), int(image.height() * 0.75))
    painter.drawImage(target_rect, image, source_rect)
    painter.end()

    return new_image
 Reduces the size of the qr code relative to the whole image. 
electrum/gui/qt/qrreader/__init__.py