Repository navigation
FITS: astrophotos to TIFF, PNG and JPG (#460) - #505
Merged
Merged
Conversation
…th (#460) FITS (.fits, .fts; ".fit" stays for Garmin FIT) is read by Filee's own reader (Magick/Fits.cs): 2880-byte blocks of 80-character cards, big-endian data, BITPIX 8/16/32/64/-32/-64 with BZERO/BSCALE and BLANK, the primary HDU or the first IMAGE extension, three-plane colour cubes, BAYERPAT/COLORTYP with XBAYROFF/YBAYROFF and ROWORDER. Tile-compressed files (fpack) fail with a message asking to funpack them. PNG, JPG and every other picture are stretched automatically (median / MAD shadows clipping at -2.8, midtones transfer to a 0.2 background, per channel) and a colour camera's mosaic is debayered bilinearly with the header's pattern unless the preset keeps it mono. FITS -> TIFF is written by a small TIFF writer of our own, since the Q8 ImageMagick stores 8 bits: linear (the data as it is) or stretched, 8-bit and 16-bit data at their depth (unsigned 16-bit through BZERO), 32-bit integer, floating-point and anything that doesn't fit as 32-bit float; uncompressed, LZW or Deflate as the preset says. The mosaic is never debayered there. New preset options ImageOptions.FitsTiff and FitsDebayer, shown in the image card for TIFF and other picture targets; schema 42 teaches the images donut the extensions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es to 43 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cre8ive-marketing
added a commit
to cre8ive-marketing/Filee
that referenced
this pull request
Oct 24, 2026
KnifeLemon#505 (FITS) took settings schema 43, so the USM step is v44 (CurrentSchemaVersion = 44), after the FITS one; its test upgrades a version 43 library.
KnifeLemon
added a commit
to xmetropolicex/Filee
that referenced
this pull request
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 of 10 tasks
KnifeLemon
added a commit
to flexeykinDev/Filee
that referenced
this pull request
Oct 24, 2026
FITS (KnifeLemon#505) took settings schema 43, so Cut a clip moves to 44. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filee reads FITS pictures (
.fits,.fts) from telescope cameras and capture/stacking programs, as planned in #460..fitis not claimed: it stays free for Garmin FIT (#451).What it does
Reading (
Magick/Fits.cs, written from the FITS 4.0 standard, no new dependency)BAYERPAT, elseCOLORTYP(RGGB, BGGR, GRBG, GBRG; case and padding ignored), at the first stored pixel and shifted byXBAYROFF/YBAYROFF. Keywords missing from an extension are looked up in the primary header.ROWORDER = 'BOTTOM-UP'turns the picture upright. Without it, rows are taken top-down, as capture programs write them.ZIMAGE = T) fail with a message asking tofunpackthem. Damaged or cut-short files fail with a reason.FITS → PNG / JPG (and every other picture target) (
Magick/FitsRendering.cs)FITS → TIFF (
Magick/TiffWriter.cs, our own small baseline TIFF writer, because the Q8 ImageMagick stores only 8 bits)Settings and UI
ImageOptions.FitsTiff(lenient enum) andImageOptions.FitsDebayer(default true; presets saved before this read as linear TIFF and debayer). Both are shown in the preset editor's image card: the TIFF choice for TIFF targets, the checkbox for the other picture targets..fitsand.ftswithout taking them from a donut of the user's. Schema 42 is the print studio from feat(spreadsheet): preview and edit XLSX page layout before PDF export #437.docs/ENGINES.md(table row and a FITS section), and the 13 READMEs (FITS in the images row, 255 → 256 formats).What it doesn't do
.fz) or table-only FITS. No data cubes beyond three colour planes (the first plane is taken).ROWORDERkeyword, files are taken as top-down (what N.I.N.A., MaxIm DL and similar capture programs write; PixInsight's default view). DS9-style bottom-up viewers would show such a file flipped. The Bayer pattern is read at the first stored pixel.Tests
tests/Filee.Engines.Tests/FitsTests.cs(25 tests; FITS and TIFF files are generated in the tests):COLORTYP; the same mosaic kept mono; the linear TIFF keeping it.ROWORDER, rotation of a TIFF, header parsing (D exponents, quoted strings, repeated keywords), an IMAGE extension, fpack / not-FITS / truncated files, the stretch math, and the routes (FITS → PDF never via TIFF).tests/Filee.Core.Tests/FitsFormatTests.cs: extension detection (.fitis not FITS), the images donut, the schema 43 migration keeping a custom claim, and old/new preset JSON.RenderTests.Preset_editor_shows_and_saves_the_fits_options(en, ko).dotnet format --verify-no-changesis clean.Closes #460
🤖 Generated with Claude Code