Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:09:44+00:00 2026-05-26T09:09:44+00:00

I am writing an web application where I need to send an image from

  • 0

I am writing an web application where I need to send an image from servlet to client. Image is generated dynamically and is quite big(+-2MB). It might be jpeg, png, or gif.

Now, I am using ImageIO.write() to write the image to output stream, but its veeeery slow. It takes up to 6 seconds till the client see the image. I need to speed it up.

Any suggestions?

btw. I am aware of Looking for a faster alternative to ImageIO topic. But it didn’t help me.
Since it’s slow with PNG ImageMagick is not a solution and
I have tested JAI and it was even worse.

Thanks in advance

Edit:

To show you some code:

BufferedImage bi = [code to generate Image];
response.setContentType(mime);
ServletOutputStream out = response.getOutputStream();
ImageIO.write(bi,"png",out);

I stripped down Exception handling for readability.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:09:45+00:00Added an answer on May 26, 2026 at 9:09 am

    Image encoding in java is pretty slow in general but you may also want to ensure you have the native libraries installed as they make quite a noticeable difference in performance.

    http://download.java.net/media/jai-imageio/builds/release/1.1/INSTALL-jai_imageio.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing web application where I need to push data from server to the
I'm writing a web application and need to initialize some parameters that I'm pulling
I have a web application that I'm writing (C#, MSSQL) and I need to
I am writing an application that will need to send a massive amount of
I need to send email notifications in my Java web application. I'm using Apache
I need your advice. I'm writing an ASP.NET web application and I'm considering whether
I'm writing a web application, I need to do a audit log for all
I'm writing a web application in PHP which needs to store images and image
I am currently writing an web application where you need to log in, using
I am writing a web application deployment verification tool and I need to check

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.