Enhanced Image Format Selection #9600
kadykov
started this conversation in
Feature Requests
Replies: 1 comment
-
Very much looking forward for this function! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Introduction
Quarto is a versatile tool for creating documents in various formats, including HTML, DOCX, and PDF. Currently, users can specify a
default-image-extension
field for each output format. However, this approach restricts users to a single image format per output format, which may not be optimal for all scenarios. This proposal suggests enhancing Quarto's image format selection mechanism to allow for greater flexibility and optimization.The problem
Suppose you're creating a Quarto document with vector images, lossy and lossless bitmap images. You want to render this document to HTML, PDF and DOCX formats with the optimal image quality and file size for different types of images.
HTML Output
Therefore, you'd like to specify AVIF for lossy bitmap images, SVG for vector images, and WebP for lossless bitmap images in the HTML output.
PDF Output
rsvg-convert
. Therefore, you might want to use PDF figures instead of SVG graphics.Therefore, in PDF output, you would prefer PDF for vector graphics, JPG for bitmap images, and PNG for lossless bitmap images.
DOCX Output
Therefore, in DOCX output, you would choose JPG for bitmap images and PNG for both vector graphics and lossless bitmap images, ensuring seamless integration with Microsoft Word.
Proposal:
Introduction of
image-extensions
Fieldimage-extensions
under the format configuration section in Quarto documents.default-image-extension
is not available.By allowing users to specify a list of image extensions for each output format, the proposed enhancement empowers them to tailor image format selection according to the specific requirements and constraints of different output formats, ensuring optimal quality, compatibility, and efficiency in document rendering.
Compatibility Considerations:
image-extensions
field will continue to use the default behavior, where only thedefault-image-extension
is considered.Example Usage
Implementation Details
quarto-cli
to support theimage-extensions
field.default-image-extension
andimage-extensions
.image-extensions
.Benefits
Conclusion
The proposed enhancement to Quarto's image format selection mechanism offers users more flexibility and control in choosing the most suitable image formats for their documents. By introducing the
image-extensions
field, Quarto becomes more versatile and adaptable to a wider range of use cases and requirements.Beta Was this translation helpful? Give feedback.
All reactions