File: fitspng.html

package info (click to toggle)
fitspng 1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,804 kB
  • sloc: sh: 1,232; ansic: 860; makefile: 14
file content (745 lines) | stat: -rw-r--r-- 21,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE HTML>
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="FITS to PNG format converter">
<meta name="author" content="Filip Hroch">
<meta name="keywords" content="FITS, png, astronomy, digital, photography, astrophotography">
<title>Fitspng</title>
<style>
body { margin-left: auto; margin-right: auto; padding-top: 0em; padding-bottom: 0em; width: 50em;}
h1 { font-size: 140%; margin-left: 0%; margin-top: 1em; font-family: sans-serif; border-bottom: thin dotted #8AB8E6; color: #8AB8E6;}
h2 { font-size: 100%; font-family: sans-serif; margin-left: 0%; margin-top: 2em; border-bottom: thin dotted #8AB8E6; color: #8AB8E6;}
h3 { font-size: 100%; margin-left: auto; margin-right:0; width:45em;margin-top: 2em; color: #8AB8E6;}
pre { font-family: monospace; background: rgb(244,244,244); overflow: auto; width: 45em; margin-left: auto; margin-right: auto;}
p { width: 45em; margin-left: auto; margin-right: 0;}
p.indent:first-letter { padding-left: 2em; }
p.abstract { margin-top: 0em; margin-left: auto; margin-right: 0; margin-bottom:2em; text-align: right; font-style:italic;}
p.picture { font-size: 95%; text-align: center; margin-bottom: 2em; width: 352px;}
p.caption { font-size: 95%; text-align: center; margin-bottom: 2em;}
div.lp { float: left; }
div.rp { margin-left: 382px; }
div.pic { margin-left: auto; margin-right: 0; width: 750px;}
p.foot { font-size: 100%; margin-top: 5em; padding-top: 1em; margin-left: auto; margin-right: 0; border-top: thin dotted; text-align: center; width: 100%}
ul, dl { width: 45em; margin-left: auto; margin-right: 0;}
li { margin-top: 0.5em; }
dt { margin-top: 1em; }
dd { margin-top: 0.2em; }
dl { margin-bottom: 1em; }
span.par{ font-weight: bold; font-family: sans-serif; color: #8AB8E6; margin-right: 0.618em; }
</style>
</head>


<body>

<h1>Fitspng</h1>

<p class="abstract">
Fitspng is an utility intended to convert of images in astronomical FITS
to PNG format.
</p>


<h2>Introduction</h2>

<p>
<a href="http://fits.gsfc.nasa.gov/">FITS</a> format is a general purpose
astronomical image format. FITS images stores measurements of a
physical quantity — an array of the angular distribution of
the photon events or the optical intensity.
Fitspng does visualisation of such array by converting them
to the images in <a href="http://www.libpng.org/pub/png/">PNG</a> format.
</p>


<h2>Tone mapping</h2>

<p>
  Fitspng applies a
  <a href="http://en.wikipedia.org/wiki/Tone_mapping">global tone mapping</a>
  technique to transform of a wide dynamical range of FITS files
  (naturally including
  <a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging">HDR</a>)
  to the limited range of, so called, modern displaying devices and
  image formats.
</p>

<p class="indent">
  The tone mapping includes these steps:
  a linear pre-scaling and optional application of an intensity
  transfer function.
</p>

<p class="indent">
  <span class="par">Pre-scaling</span>
  maps linearly the captured counts, related to optical
  <a href="https://en.wikipedia.org/wiki/Intensity_(physics)">intensities</a>
  <i>I</i> (<i>I ∋ ℝ, I ≥ 0 </i>), to the range
  <i>0 ≤ t ≤ 1</i> by the two parameter transformation:
</p>
<p class="indent">
<i>t = (I - B) / s</i>.
</p>
<p>
  As the parameters, <i>B</i> – black level, and
  <i>s</i> – sensitivity, has been selected.
</p>
<p class="indent">
  <i>B</i> sets a background level in original data. It corresponds to zero
  in transformed values, and finally to the black colour.
</p>
<p class="indent">
  The sensitivity <i>s > 0</i> adjusts
  a range of FITS values visible on PNG pictures.
  It simulates the artificial sensitivity of a detector:
  adjusting of sensitivity <i>s</i> leads to a dim, or highlight, images
  — it operates like a gain of an electronic amplifier of a detector.
  This parameter is a reciprocal quantity to ISO value used by photographers.
</p>
<p class="indent">
  The linear transformation
  should be followed by a cut-off, which assigns
  all values below the level <i>B</i> to be black,
  and over the interval to be white:
</p>
<p class="indent">
  <i>
    t = { (I - B) / s  ∈ (0, 1) }
  </i>
</p>
<p>
</p>

<p>
  <span class="par">Itt scaling</span> applies a
  intensity transfer function <i>f(t)</i>
  (the intensity transfer table ITT in the past)
  on the pre-scaled data <i>t</i>:
</p>
<p class="indent">
  <i>τ = f<sub>0</sub> · f(t) + z<sub>0</sub></i>,
</p>
<p>
  <i>f<sub>0</sub>, z<sub>0</sub></i> are
  Itt function scaling parameters (<i>f<sub>0</sub>=1</i>,
  <i>z<sub>0</sub>=0</i> by default).
  If <i>f(t)</i> is the linear function, the function becomes identity
  <i>τ = t</i>, and <i>f<sub>0</sub>, z<sub>0</sub></i> remains no applied.
</p>

<p class="indent">
  Various Itt functions (linear, logistics .. ) are
  described in paragraph <a href="#itt">Itt functions</a>.
</p>



<p>
  <span class="par">Gamma correction</span>
  Finally, the light-sensitivity model, specific to a displaying device,
<a href="http://en.wikipedia.org/wiki/SRGB">sRGB</a> or
<a href="http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf">AdobeRGB (pdf)</a>
is applied onto <i>τ</i> values by Gamma function <i>Γ(τ)</i>:
</p>
<p class="indent">
  <i>p = { 255 Γ(τ)  ∈ (0, 255) }</i>,
</p>
<p>
where <i>p</i> is the final value stored in PNG.
</p>

<p class="indent">
  The described pre-scaling is applied on all pixels in the frame;
  one is applied on values for grey-scale,
  and on every channel of colour images.
</p>

<p class="indent">
  Both <i>B, s</i> parameters can be leaved unspecified:
  they are estimated
  by the included machine algorithm described in
  <a href="#tone">Tone parameters estimation</a>.
  A manual setup of the pre-scale parameters is available in two modes:
</p>
<ul>
  <li><b>Absolute:</b>
    the linear pre-scaling is given by the provided parameters
    <i>B, s</i> or,
  <li><b>Relative:</b>
    if internally estimated parameters are scaled.
  </li>
</ul>


<h2 id="tone">Tone parameters estimation</h2>

<p>
  A reliable setup of the scaling parameters <i>B, s</i> is crucial
  for proper function of Fitspng; a novel
  approach on base of quantiles of an empirical distribution function
  has been developed.
</p>

<p class="indent">
  <span class="par">Background </span> level is estimated as
  25% <a href="https://en.wikipedia.org/wiki/Quantile">quantile</a>
  <i>Q</i><sub>B</sub> of
  <a href="https://en.wikipedia.org/wiki/Empirical_distribution_function">
    empirical CDF</a> of observed pixels.
  It is close to CDF of
  <a href="https://en.wikipedia.org/wiki/Normal_distribution">Normal
    distribution</a> for the sky, a star free background.
  The black level is adjusted by the quantile:
</p>
<p>
  <i>
    B = Q<sub>B</sub>(¼)
  </i>
</p>
<p>
  The pixels included in determination of the CDF
  are pre-selected from a grid over the full frame
  (over 30 thousands of data points). The one-quarter value
  is a result of empirical experiments.
</p>

<p class="indent">
  <span class="par">Light</span> upper level is estimated
  as 95% quantile of the empirical CDF constructed on base of
  pixels with values above <i>≥ 3 D</i>
  of the background CDF. The pixels contains only a star light,
  or another star-gazing objects,
  and provides the range for observed intensity values.
</p>
<p>
  <i>
    s<sub>0</sub> = Q<sub>L</sub>(95%)
  </i>
</p>
<p>
  Parameter <i>D</i> is a quantile estimation of dispersion
  on base of ¼ and ¾ of <i>Q</i><sub>B</sub>
  quantiles (<i>Q<sub>N</sub>(½) ≐ 0.6745</i> is 50% quantile of
  Normal distribution):
</p>
<p>
  <i>
    D = [Q<sub>B</sub>(¾) - Q<sub>B</sub>(¼)] / [2 · Q<sub>N</sub>(½)]
  </i>
</p>

<p class="indent">
  <span class="par">Relative parameters <i>q, v</i></span>
  are defined by the way:
</p>
<ul>
  <li>
    <i>B = Q<sub>B</sub>(q)</i>
  </li>
  <li>
    <i>s = v s<sub>0</sub></i>
  </li>
</ul>

<p class="indent">
  The relative parameter <i>q ∈ (0,1)</i> is a quantile of
  <i>Q<sub>B</sub>(q)</i>.
</p>

<p class="indent">
  Common properties of <i>Q<sub>B</sub>(q)</i> are:
  <i>q = ½</i> is arithmetic mean,
  <i>q = ¼</i> (standard background level) is the mean of absolute deviations
  under the mean, <i>q=0</i> or <i>q=1</i> are minimal and maximal values.
</p>

<p class="indent">
  The parameter <i>0.001 &lt; v &lt; 1000</i> (mostly)
  adjusts relative slope against to the pre-defined value
  <i>s<sub>0</sub></i>.
</p>

<!--
gnuplot << EOF
set term svg size 640,320 dynamic linewidth 2
set output 'bcdf.svg'
set xrange[400:1500]
set key right bottom
plot 'b.dat' w l t "Image data", 0.5*(1+erf((x-706.88)/1.41/65.88)) t "Normal distribution"
set output 'bhist.svg'
set yrange[1:30500]
set xrange[1:3000]
set logscale y
plot 'bh.dat' w histeps t "Image data histogram", 26e3*exp(-(x-706.88)**2/2/65.88**2) w l t "Normal distribution density", 0.6e2*(x/2000)**-1.5 t "Asymptotic approximation"
EOF
-->

<p class="indent">
  The empirical CDF for an ordinary picture of sky is
  displayed on the graph below.
  The vertical axis shows quantiles, the horizontal axis of picture values.
  The background noise follows Normal distribution up to <i>Q</i> = 0.8;
  the star light is getting importance over the background since the level.
</p>

<div class="pic">
<img src="images/bcdf.svg" alt="cdf">
<p class="caption">
  The empirical CDF of an ordinary picture of sky, see text for description.
</p>
</div>

<div class="pic">
<img src="images/bhist.svg" alt="histogram">
<p class="caption">
  The histogram of the same frame.
</p>
</div>

<h2 id="itt">Itt functions</h2>

<p>
  Fitspng implements the functions:
</p>

<ul>
  <li>linear: <i>f(t) = t</i>,</li>
  <li>square root (sqrt): <i>f(t) = √t, t &gt; 0</i>,</li>
  <li>square (sqr): <i>f(t) = t<sup>2</sup></i>,</li>
  <li>logistics: <i>f(t) = 1 / [1 + </i>exp<i>(-2.5 t)] - 1</i>.</li>
</ul>
<p>
  The choice of analytical form of the functions
  asymptotically reproduces the linear function close to zero.
</p>

<p class="indent">
  The square root function reveals the relative error of observed values:
  the error is proportional to <i>√t / t</i> (reciprocity to the Itt above) by
  <a href="https://en.wikipedia.org/wiki/Poisson_distribution">Poisson
    distribution</a>. The bright parts of life has smaller relative errors
  over the dark parts.
</p>

<p class="indent">
  The <a href="https://en.wikipedia.org/wiki/Logistic_function">logistics
    function</a> emulates the gradation curve of
  the classical photographic emulsion.
</p>

<!--
gnuplot << EOF
set term svg size 640,320 dynamic linewidth 2
set output 'itt.svg'
set xrange[-0.01:1.01]
set yrange[-0.01:1.01]
set key left top
plot x t "linear",sqrt(x) t "sqrt", x**2 t "sqr", 2/(1+exp(-2.5*x))-1 t "logistics"
EOF
-->

<div class="pic">
<img src="images/itt.svg" alt="Itt">
</div>


<h2 id="colour">Colour tuning</h2>

<p>
  Colour FITS frames, defined by
  <a href="http://munipack.physics.muni.cz/colorfits.html">Munipack</a>,
  are recognised. The colours can be tuned.
</p>

<p class="indent">
  <span class="par">Saturation</span>
  The colour saturation of images should be reduced when
  the relative saturation parameter has value <i>c &lt; 1</i>,
  or enhanced when <i>c &gt; 1</i>. The saturation of the final frame
  is computed by formula
</p>
<p>
  <i>c √C</i>,
</p>
<p>
  with the chroma <i>C = a<sup>2</sup> + b<sup>2</sup></i> specifying
  of the saturation in
  <a href="https://en.wikipedia.org/wiki/CIELAB_color_space">L*a*b
    colour-space</a>.
</p>

<p class="indent">
  <span class="par">Nite vision</span>
  The human eye sensitivity in high and low light conditions
  can be artificially simulated by greying of dim parts of images
  by application of
  <a href="http://en.wikipedia.org/wiki/Purkinje_effect">Purkyně effect</a>.
</p>

<p>
  The photopic (colour) and scotopic vision is modelled by the
  mix weighting function
</p>
<p>
  <i>w =  ½ {1 + </i>erf<i> [(t - t<sub>n</sub>) / s<sub>n</sub>]}</i>,
</p>
<p>
  with the night vision threshold <i>t<sub>n</sub></i>,
  and a half-with of <i>s<sub>n</sub></i> of the mesotopic vision region.
  Be warned, the function has been selected by heuristic: there is no
  a proof of validity.
</p>
<p class="indent">
  The values are mixed with X, Y, Z channels giving ranges
  <i>0 &le; t<sub>n</sub> &le; 100</i> and
  <i>s<sub>n</sub> &gt; 0</i>. Pictures becomes fully coloured
  for <i>t<sub>n</sub> → 0</i>, or complete in night vision for
  <i>t<sub>n</sub> → 100</i>. The mesotopic regime has <i>t<sub>n</sub></i>
    around 50.
</p>


<h2>Image resize</h2>
<p>
An output image can be scaled-down by an integer factor. Every pixel
of the scaled image is computed as the arithmetical mean of a square
with side given by this factor.
The photometric information is preserved while a noise is suppressed
during the re-scaling. This sufficient fast method provides high quality images.
</p>

<h2>Exif information</h2>

<p>
  FITS header meta-information is stored as an EXIF information
  of PNG files: the EXIF text strings has free format and no formalised
  custom.
</p>


<h2>Fitspng invocation</h2>

<h3>Synopsis</h3>

<p>
  <b>fitspng</b> [options] file(s)
</p>

<h3>Command line options</h3>

<dl>

<dt><b>-fr</b> <i>q, v</i></dt>
<dd>
  Relative pre-scaling mode: <i>q, v</i> represents quantiles
  of a background (sky) and <i>v</i> relative sensitivity.
</dd>

<dt><b>-fl</b> <i>B, s</i></dt>
<dd>
  Absolute pre-scaling mode: <i>B, s</i> are directly used
  for scaling of the output frame.
  This setup completely disables the internal parameters estimation.
</dd>



<dt><b>-f</b> [linear|sqrt|sqr|logistic]</dt>
<dd>
  <a href="#itt">Itt function:</a> linear, square root, square, logistic.
</dd>

<dt><b>-f0</b> <i>f<sub>0</sub></i></dt>
<dd>
  The scale factor of <a href="#itt">Itt function</a>.
</dd>

<dt><b>-fz</b> <i>z<sub>0</sub></i></dt>
<dd>
  The zero point of <a href="#itt">Itt function</a>.
</dd>

<dt><b>-fs</b> <i>c</i></dt>
<dd>
The relative colour saturation (Colour FITS only).
</dd>

<dt><b>-fn</b> <i>t<sub>n</sub>, s<sub>n</sub></i></dt>
<dd>
  When used, switch-on, and <a href="#colour">setup</a>,
  mode which emulates the humans night vision (Colour FITS only).
</dd>

<dt><b>-cs</b> [sRGB|AdobeRGB]</dt>
<dd>
The colour space of the output image.
</dd>

<dt><b>-s</b> <i>s</i></dt>
<dd>
  Shrink image: scale-down the size of the image by the specified factor
  <i>s &gt; 1</i>: every output pixel is the arithmetic mean of
  <i>s<sup>2</sup></i> input pixels.
</dd>

<dt><b>-o</b> filename</dt>
<dd>
  <p>
    Specify an output file name, single file only.
  </p>
  <p>
    If this switch is omitted, the output filename is determined by
    modification of the input filename(s): suffixes, like <samp>*.fits</samp>,
    are replaced by <samp>*.png</samp>, and the directory
    path is removed: <samp>/space/image.fits</samp> is converted
    to <samp>image.png</samp>. The approach leaves original
    data untouched, results are stored in the current working
    directory (see also <a href="#examples">Examples</a>).
    </p>
</dd>

<dt><b>-B</b> [8|16]</dt>
<dd>
  The bit depth of the output PNG frame: 8 (default) or 16 bites per pixel.
<br>
A post-processing can be affected by the choice; most utilities
doesn't work with 16-bit colour depth correctly.
</dd>

<dt><b>-v</b>, --verbose</dt>
<dd>
Be verbose.
</dd>

<dt><b>-h</b>, --help, --version</dt>
<dd>
Shows summary of options, or the current version.
</dd>
</dl>


<h2 id="examples">Examples of usage</h2>

<p>
Convert a FITS image to PNG:
</p>
<pre>
$ fitspng -o grey.png grey.fits
</pre>

<p>
Emulate the human night vision:
</p>
<pre>
$ fitspng -o scotopic.png colour.fits
</pre>

<p>
Emulate the classical photography sensitivity function (gradation curve):
</p>
<pre>
$ fitspng -f logistic -o photo.png colour.fits
</pre>

<p>
Create a semi-grey image:
</p>
<pre>
$ fitspng -fs 0.2 -o reduced.png colour.fits
</pre>

<p>
  Generate thumbnails of FITS files in /space;
  files are stored under the current directory
</p>
<pre>
  fitspng -s 10 /space/*.fits
</pre>
<p>
  The same result should be emulated with help of shell scripting
  (providing powerful file name manipulations):
</p>
<pre>
  $ for FITS in /space/*.fits; do
      NAME=$(basename $FITS);
      PNG=${NAME%fits}png;
      fitspng -s 10 -o $PNG $FITS;
  done
</pre>

<p>
  Fitspng has no parallel run support build-in due portability issues;
  however, the execution time on multiprocessor systems should be significantly
  reduced with help of an external utility:
</p>
<pre>
  $ ls /space/*.fits | xargs -n 1 -P 2 fitspng
</pre>
<p>

<h2>Gallery</h2>


<div style="padding:1em;"></div>

<div class="pic">
<div class="lp">
<img src="images/IMG_5952.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#1, Colour image in sRGB
</p>
</div>

<div class="rp">
<img src="images/IMG_5952_a.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#2, Colour image in AdobeRGB
</p>
</div>
</div>

<div class="pic">
<div class="lp">
<img src="images/IMG_5952_fr10.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#3, Highlighted
</p>
</div>

<div class="rp">
<img src="images/IMG_5952_fr50.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#4, Shadowed
</p>
</div>
</div>

<div class="pic">
<div class="lp">
<img src="images/IMG_5952_s05.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#5, Reduced colours
</p>
</div>

<div class="rp">
<img src="images/IMG_5952_s15.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#6, Enhanced colours
</p>
</div>
</div>

<div class="pic">
<div class="lp">
<img src="images/IMG_5952_ph.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#7, Photography tone
</p>
</div>

<div class="rp">
<img src="images/IMG_5952_fn.png" width="352" height="234" alt="IMG_5952">
<p class="picture">
#8, Night vision
</p>
</div>
</div>

<p>
  All this gallery examples has been generated
  by processing of the reference raw photo
<a href="http://integral.physics.muni.cz/rawtran/IMG_5952.CR2">IMG_5952.CR2
</a>:
</p>
<pre>
$ rawtran -o IMG_5952.fits IMG_5952.CR2
$ fitspng                 -s 10 -o IMG_5952.png      IMG_5952.fits  #1
$ fitspng -cs AdobeRGB    -s 10 -o IMG_5952_a.png    IMG_5952.fits  #2
$ fitspng -fr 3,10        -s 10 -o IMG_5952_fr10.png IMG_5952.fits  #3
$ fitspng -fr 3,50        -s 10 -o IMG_5952_fr50.png IMG_5952.fits  #4
$ fitspng -fs 0.5         -s 10 -o IMG_5952_s05.png  IMG_5952.fits  #5
$ fitspng -fs 1.5         -s 10 -o IMG_5952_s15.png  IMG_5952.fits  #6
$ fitspng -f logistic     -s 10 -o IMG_5952_ph.png   IMG_5952.fits  #7
$ fitspng -fn 3000,100    -s 10 -o IMG_5952_fn.png   IMG_5952.fits  #8
</pre>

<h2>Download and installation</h2>

<p>
  The <a href="ftp://integral.physics.muni.cz/pub/fitspng/">tar-ball</a>,
  or the <a href="http://integral.physics.muni.cz/hg/fitspng/">development
    repository</a>, is freely available under GPL-3 licence.
  Both
<a href="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">cfitsio</a> and <a href="http://www.libpng.org/pub/png/libpng.html">libpng</a>
libraries, including files required for development (headers, static libraries),
are necessary for building.
</p>

<ul>
<li>
Fitspng runs under any Unix-like operating system (all flavours
of GNU/Linux and BSD, Solaris, Mac OS X, etc).
<li>
  Fitspng packages can be found in
  <a href="https://packages.debian.org/fitspng">Debian</a> and
  <a href="http://packages.ubuntu.com/fitspng">Ubuntu</a>.
</li>
<li>
Jean-Paul Godard
reported successful compilation under W7 (64b) environment
and mingw.
</li>
<li>
Fitspng can be compiled under Windows 8 (64-bit) with mingw
compiler (libpng will be required).
</li>
</ul>

<p><a href="http://www.tuxfiles.org/linuxhelp/softinstall.html">
A recommended way</a> of installation under Unix-like system is:</p>

<pre>
$ tar zxf fitspng-X.Y.Z.tar.gz
$ cd fitspng-X.Y.Z/
$ autoreconf -i   # for Mercurial
$ ./configure CFLAGS="-O4 -DNEBUG"
$ make
# make install
</pre>

<p>The last step should be executed under root account.
Both binary and
man page are installed under <code>/usr/local</code> tree. It would be
nice to keep the directory for case of later uninstalling.</p>


<h2>See also</h2>
<p>
<a href="http://munipack.physics.muni.cz">Munipack</a> is a general utility
to work with FITS images.
</p>

<p>
Development notes can be found in
<a href="http://monteboo.blogspot.com/search/label/Fitspng">Hroch's diary.</a>
</p>

<h2>License</h2>
<p>
  Fitspng is <a href="http://www.gnu.org/philosophy/free-sw.html">free
    software</a> licensed under the
  <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>.
  This gives you the freedom to use and modify Fitspng to suit your needs.
</p>

<p class="foot">
  Copyright &copy; 2006 — 2019, <a href="mailto:hroch@physics.muni.cz">F. Hroch</a>,
<a href="http://www.physics.muni.cz">Institute of Theoretical Physics and Astrophysics</a>,
<a href="http://www.muni.cz/en">Masaryk University</a>,
<a href="http://en.wikipedia.org/wiki/Brno">Brno</a>,
<a href="http://en.wikipedia.org/wiki/Czech_Republic">Czech Republic</a>.
</p>

</body>
</html>