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 8428463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:03:58+00:00 2026-06-10T05:03:58+00:00

I try to read (in a BufferedImage ) a 14 or 16 bits image

  • 0

I try to read (in a BufferedImage) a 14 or 16 bits image over 1 or 3 channels (grayscale or RGB). I precise, each color component of this image is stored on 14 or 16 bits.

My code (using Apache Sanselan / Imaging) read the image but each color component is truncated to 8 bits.

File f = new File("/tmp/a.tiff");
Map<String, ManagedImageBufferedImageFactory> params = 
    new HashMap<String, ManagedImageBufferedImageFactory>();
params.put(ImagingConstants.BUFFERED_IMAGE_FACTORY, 
    new ManagedImageBufferedImageFactory());
BufferedImage image = Imaging.getBufferedImage(file, params);

Could you provide me a code snippet ? I’m stuck for 6 hours and Google does not want to help me :-p

  • 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-06-10T05:03:59+00:00Added an answer on June 10, 2026 at 5:03 am

    Okay ! I close my question by myself 😛

    I finally found a jar of Java Advanced Imaging. JAI solved my problem.

    The following code is able to load TIFF or BMP image of any numbers of components with any depth for each.

            RenderedOp op = JAI.create("fileload", filename);
            // gets the number of channels (R / RGB / RGBA)
            channels =  op.getColorModel().getNumColorComponents();
            // gets the depth of each component (16 16 16)
            depth = new int[channels];
            for(int i=0; i<op.getColorModel().getNumColorComponents(); i++)
            {
                depth[i] = op.getColorModel().getComponentSize(i);
            }
            // gets the BufferedImage
            image = op.getAsBufferedImage();
    

    Thanks !!

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

Sidebar

Related Questions

BufferedImage img = null; ImageIcon icon = null; try { img = ImageIO.read(new File(resources/
I'm trying to read a TIFF image from file using BufferedImage. The following is
i try to read Data from an Oracle-Database. The problem is that in some
I try to read out all existing calendars. I want have a HashMap with
I try to read out all existing calendars. I tried the example from here:
I try to read a text files with 20x20 data into variable C, and
I try to read file /proc/'pid'/status, using c program. The code is as follows,
When I try to read bash history into vim, I get nothing. :r !history
When i try to read a JSON string like below it goes to endless
As a relative newbie I try to read as much as I can about

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.