# data URI to `BufferedImage` [TOC] ###### tags: `java` `imaging` --- ```java String encodingPrefix = "base64,"; int contentStartIndex = dataUrl.indexOf(encodingPrefix) + encodingPrefix.length(); byte[] imageData = Base64.decodeBase64( dataUrl.substring(contentStartIndex) ); ``` ## References - [StackOverflow: Convert Data-URL to BufferedImage](https://stackoverflow.com/questions/18569591/convert-data-url-to-bufferedimage) - [Wikipedia: data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up