Uses 38K of libraries. Click here for Pure Java version (77L/1K).
1 | !include once #1035902 // QOI Library [Include] |
2 | |
3 | static byte[] toQOI(BufferedImage image) ctex { |
4 | if (image == null) null; |
5 | |
6 | new ByteArrayOutputStream stream; |
7 | var imageWriter = new QOIImageWriterSPI().createWriterInstance(); |
8 | |
9 | try { |
10 | imageWriter.setOutput(new javax.imageio.stream.MemoryCacheImageOutputStream(stream)); |
11 | imageWriter.write(image); |
12 | } finally { |
13 | imageWriter.dispose(); |
14 | } |
15 | |
16 | ret stream.toByteArray(); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1035903 |
Snippet name: | toQOI - encode image as QOI (Quite OK Image) in memory. QOI is a super-fast alternative to PNG with similar compression rates |
Eternal ID of this version: | #1035903/2 |
Text MD5: | ef7b18478dba8e82637f11093b87ad39 |
Transpilation MD5: | 107dac784a098d15f8bfff658f75d81c |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-11 19:13:32 |
Source code size: | 455 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 152 / 203 |
Version history: | 1 change(s) |
Referenced in: | [show references] |