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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:19:54+00:00 2026-05-31T05:19:54+00:00

Background I have a large TIFF file that is compressed with JPEG (new, compression

  • 0

Background
I have a large TIFF file that is compressed with JPEG (new, compression 7 in TIFF standard) and is tiled. What I need to do is extract these tiles to individual .jpg files. I need to be able to do this with out decompressing/recompressing the image data because that will require too much compute resources, so all libraries that I know of are out of the question.

I know a lot about TIFF file structure, but almost nothing about JPEG file structure. I have code written right now that reads the JPEGTable tag data from the tiff header into a byte array (meaning it goes to the offset pointed at by the tag and reads it there) And another blurb of code that reads the target Tile into a byte array. Then I am writing the Table byte array to a new file, then writing the Tile byte array to that file after that. The last 2 bytes of the Table array I write over with 0xFF, 0xFF and the same for the first 2 bytes of the Tile array, because I found that both arrays start and end with the jpeg SOI and EOI sequences respectively and if I had more than 1 of each, the files wouldn’t be openable by any image programs.

For i as Integer = 0 to TableArray.Count-3
    stream.WriteByte(TableArray(i))
Next
stream.WriteByte(255)
stream.WriteByte(255)
stream.WriteByte(255)
stream.WriteByte(255)
For i as Integer = 2 to TileArray.Count-1
    stream.WriteByte(TileArray(i))
Next
stream.Close()

Problem
So that is where I am right now, the problem is that my extracted tiles are all shaded pink where it should be white, almost like a color negative. It isn’t solid Pink, I can see outlines of objects I know are in the original image. Does any one have any ideas how I might be able to solve this? Also, I am doing this in VB.NET, but I don’t think the language really matters in this case as it seems to be more of a concept/algorithm/file structure issue I am doing wrong.

If some one would like me to post some of the code I am using, I can, just need to know which part.
Extracted
Original

EDIT: I found in the Adobe Photoshop TIFF Technical Notes from March 22, 2002 a section that says:

Conversion from TIFF to interchange JPEG is more complex. A strip-based TIFF/JPEG file can be converted fairly easily if all strips use identical JPEG tables and no RSTn markers: just delete the overhead markers and insert RSTn markers between strips. Converting tiled images is harder, since the data will usually not be in the right order (unless the tiles are only one MCU high). This can still be done losslessly, but it will require undoing and redoing the entropy coding so that the DC coefficient differences can be updated.

Not sure if that is relevant to my problem or not.

  • 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-31T05:19:55+00:00Added an answer on May 31, 2026 at 5:19 am

    The difficulty with TIFF files produced by Photoshop is that they support writing the RGB colorspace into JPEG compressed data. If you extract a single tile from your TIFF file and write it as an independent JPEG image, it will not display correctly because decoders assume that the colorspace is YCbCr. There is a solution as long as the viewing application respects the Adobe APP14 marker. Included in this marker is a byte which defines the transform (colorspace). If you insert this sequence of bytes before the SOI, your image will display correctly on many viewers.

    FF EE 00 0E 41 64 6F 62 65 00 64 80 00 00 00 00

    The last byte defines the transform; in this case 0 indicates the RGB colorspace. You can read more about it here:

    Oracle JPEG metadata doc

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

Sidebar

Related Questions

Background: I have a large 2D array of integers that I need to load
I have a site that uses a large centered background image, which naturally loads
Background Info: I have a large body of text that I regularly encapsulate in
I have a large png that I would like to use as a background
Background I have a large number of fields that will be updating real time
Background: I have a project that is not at all large scale (2 ASP.NET
I have a large number of background reads and writes, and a much smaller
I am designing a Game and have a large background. The background it a
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may

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.