4 ms·
Really neat! Thanks for these. Can you tell me how to generally go about making these converters? I've always wondered how all these file conversions (especia
by kretaceous 5y ago
Really neat! Thanks for these.
Can you tell me how to generally go about making these converters?
I've always wondered how all these file conversions (especially the image ones) are developed. Is it specific for one file type to another or is there some general method which can be used? How is this achieved in the browser itself?
- growt 5y agoMost of these go through a canvas element, which is something a browser can "draw on". For conversion from jpg to png for example you don't need any libraries at all because your webbrowser can read and write both of these formats: "draw" jpg on a canvas and read it as png, done. For others like heic and pdf I used open source JS libraries such as pdfJS.
- aardvark179 5y agoAlthough that is an approach that can work, it's likely a very good way to either lose the colour space and meta data for an image, or to force it into sRGB. which is always a little disappointing if the source and destination support something better.