33This program displays an image with libvips and gtk+4. This is supposed
44to be a slightly useful image viewer. It can display huge (many, many GB)
55images quickly and without using much memory. It supports many scientific
6- and technical image formats, including TIFF, WEBP, JP2K, JXL, PNG, JPEG ,
7- SVS, MRXS, OpenEXR, GIF, PDF, SVG, FITS, Matlab, NIfTI, Analyze, etc. It
6+ and technical image formats, including TIFF, WEBP, JP2K, JXL, AVIF, HEIC, PNG ,
7+ JPEG, SVS, MRXS, OpenEXR, GIF, PDF, SVG, FITS, Matlab, NIfTI, Analyze, etc. It
88supports pixel types from 1 bit mono to 128-bit double precision complex.
99
1010All of the UI can make finding the details of image display in the sourcecode
@@ -22,6 +22,8 @@ It all works, though see the TODO list below.
2222
2323[ ![ Screenshot] ( images/shot3.png )] ( images/shot3.png )
2424
25+ [ ![ Screenshot] ( images/save-as.png )] ( images/save-as.png )
26+
2527## Install
2628
2729This program is on flathub, see:
@@ -37,12 +39,9 @@ flatpak install flathub org.libvips.vipsdisp
3739## Features
3840
3941* It supports many scientific and technical image formats, including TIFF,
40- WEBP, JP2K, JXL, PNG, JPEG, SVS, MRXS, OpenEXR, GIF, PDF, SVG, FITS,
41- Matlab, NIfTI, Analyze, etc. It supports many numeric pixel types, any
42- number of image bands, many colour spaces.
43-
44- * It has Save as, so you can use it for image format conversion. Though
45- there's currently no GUI for save options, sadly.
42+ WEBP, JP2K, JXL, HEIC, AVIF, PNG, JPEG, SVS, MRXS, OpenEXR, GIF, PDF, SVG,
43+ FITS, Matlab, NIfTI, Analyze, etc. It supports many numeric pixel types,
44+ any number of image bands, many colour spaces.
4645
4746* It doesn't need to keep the whole image in memory. It will only read parts
4847 that it needs for display, and it understands most pyramidal image formats.
@@ -53,6 +52,13 @@ flatpak install flathub org.libvips.vipsdisp
5352 the screen as they are finished. The interface stays live even under very
5453 heavy load.
5554
55+ * It keeps a sparse pyramid of tiles as textures on the GPU. For each frame,
56+ it computes the set of visible tiles, and then the GPU scales, positions and
57+ composites just those tiles to the screen. CPU load should be low (except
58+ for the background workers heh). Hold down i (for "in") or + to do a smooth
59+ zoom on the cursor. If you press "d" it toggles a debug display mode which
60+ shows the tiles being computed.
61+
5662* Select * Display control bar* from the top-right menu and a useful
5763 set of visualization options appear. It supports four main display modes:
5864 Toilet roll (sorry), Multipage, Animated, and Pages as Bands.
@@ -68,6 +74,10 @@ flatpak install flathub org.libvips.vipsdisp
6874 images. Scale and offset sliders let you adjust image brightness to see into
6975 darker areas (useful for HDR and many scientific images).
7076
77+ * Select Save as to write an image. It can write most common formats, and lets
78+ you set file save options. It can write things like DeepZoom pyramids, PFM,
79+ OpenEXR, and so on.
80+
7181* It uses the gtk4 GUI toolkit, so the interface is fast, attractive
7282 and nicely animated. The image is rendered with the GPU, so display ought to
7383 be fast.
@@ -124,12 +134,120 @@ $ vipsdisp ~/pics/k2.jpg
124134 adds a lot of navigation stuff. It uses the scolled
125135 window ` GtkAdjustment ` to slide ` Imagedisplay ` around.
126136
137+ * ` SaveOptions ` is the save-as dialog, and uses libvips introspection to
138+ display the optional parameters of the selected saver.
139+
127140* ` disp ` is the ` main() ` , ` VipsdispApp ` is a ` GtkApplication ` subclass
128141
129142* The UI layout is in the ` gtk/*.ui ` xml.
130143
144+ ## Version bump checklist
145+
146+ Version needs updating in the following places:
147+
148+ - ** ` org.libvips.vipsdisp.appdata.xml ` ** and some release notes and a date as
149+ well.
150+
151+ - ** ` org.libvips.vipsdisp.json ` ** needs the version number as a git tag.
152+
153+ ## flatpak
154+
155+ Add the ` flathub ` repo:
156+
157+ ```
158+ flatpak remote-add --if-not-exists \
159+ flathub https://flathub.org/repo/flathub.flatpakrepo
160+ ```
161+
162+ Install the gtk4 SDK and runtime:
163+
164+ ```
165+ flatpak install org.gnome.Sdk//44
166+ flatpak install org.gnome.Platform//44
167+ ```
168+
169+ Allow file. Recent security changes to git will cause submodule checkout
170+ to fail inside flatpak. If you get errors like `fatal: transport 'file'
171+ not allowed`, reenable file transport with:
172+
173+ ```
174+ git config --global protocol.file.allow always
175+ ```
176+
177+ Build and try running it:
178+
179+ ```
180+ flatpak-builder --force-clean --user --install build-dir org.libvips.vipsdisp.json
181+ flatpak run org.libvips.vipsdisp ~/pics/k2.jpg
182+ ```
183+
184+ Force a complete redownload and rebuild (should only rarely be necessary) with:
185+
186+ ```
187+ rm -rf .flatpak-builder
188+ ```
189+
190+ Check the files that are in the flatpak you built with:
191+
192+ ```
193+ ls build-dir/files
194+ ```
195+
196+ Uninstall with:
197+
198+ ```
199+ flatpak uninstall vipsdisp
200+ ```
201+
202+ ## Notes on flatpak build process
203+
204+ - niftiio is annoying to build, skip it.
205+
206+ - we skip imagemagick as well, too huge
207+
208+ ## Packaging for flathub
209+
210+ Install the appdata checker:
211+
212+ ```
213+ flatpak install flathub org.freedesktop.appstream-glib
214+ flatpak run org.freedesktop.appstream-glib validate org.libvips.vipsdisp.appdata.xml
215+ ```
216+
217+ Also:
218+
219+ ```
220+ desktop-file-validate org.libvips.vipsdisp.desktop
221+ ```
222+
223+ ## Uploading to flathub
224+
225+ Push to master on:
226+
227+ https://github.com/flathub/org.libvips.vipsdisp
228+
229+ then check the build status here:
230+
231+ https://flathub.org/builds/#/apps/org.libvips.vipsdisp
232+
131233## TODO
132234
235+ - load progress bar often left up after "replace image"
236+
237+ - add HEIC (hvec) to flatpak build?
238+
239+ - save-as can set nickname and description twice?
240+
241+ - save-as to xxx.heic, set compression to hvec
242+
243+ - press save, get "unsupported codec"
244+
245+ - press save again, get
246+
247+ (vipsdisp:2): VIPS-WARNING ** : 11:37:48.922: ../libvips/iofuncs/object.c:1234 : VipsForeignSaveHeifFile can only assign 'nickname' once
248+
249+ (vipsdisp:2): VIPS-WARNING ** : 11:37:48.922: ../libvips/iofuncs/object.c:1234 : VipsForeignSaveHeifFile can only assign 'description' once
250+
133251- gtk 4.10 added GSK_SCALING_FILTER_NEAREST and GskTextureScale ... use this
134252 for the main window
135253
@@ -217,100 +335,7 @@ $ vipsdisp ~/pics/k2.jpg
217335
218336- auto reload on file change, or support F5 for reload?
219337
220- - load image with long progress bar, ^D during load, progress bar stops
221- updating
222-
223- - no progress bar for replace? it works for initial load though
224-
225338- progress bar occasionally never shows even on a long load
226339
227340- header display
228341
229- ## Version bump checklist
230-
231- Version needs updating in the following places:
232-
233- - ** ` org.libvips.vipsdisp.appdata.xml ` ** and some release notes and a date as
234- well.
235-
236- - ** ` org.libvips.vipsdisp.json ` ** needs the version number as a git tag.
237-
238- ## flatpak
239-
240- Add the ` flathub ` repo:
241-
242- ```
243- flatpak remote-add --if-not-exists \
244- flathub https://flathub.org/repo/flathub.flatpakrepo
245- ```
246-
247- Install the gtk4 SDK and runtime:
248-
249- ```
250- flatpak install org.gnome.Sdk//43
251- flatpak install org.gnome.Platform//43
252- ```
253-
254- Allow file. Recent security changes to git will cause submodule checkout
255- to fail inside flatpak. If you get errors like `fatal: transport 'file'
256- not allowed`, reenable file transport with:
257-
258- ```
259- git config --global protocol.file.allow always
260- ```
261-
262- Build and try running it:
263-
264- ```
265- flatpak-builder --force-clean --user --install build-dir org.libvips.vipsdisp.json
266- flatpak run org.libvips.vipsdisp ~/pics/k2.jpg
267- ```
268-
269- Force a complete redownload and rebuild (should only rarely be necessary) with:
270-
271- ```
272- rm -rf .flatpak-builder
273- ```
274-
275- Check the files that are in the flatpak you built with:
276-
277- ```
278- ls build-dir/files
279- ```
280-
281- Uninstall with:
282-
283- ```
284- flatpak uninstall vipsdisp
285- ```
286-
287- ## Notes on flatpak build process
288-
289- - niftiio is annoying to build, skip it.
290-
291- - we skip imagemagick as well, too huge
292-
293- ## Packaging for flathub
294-
295- Install the appdata checker:
296-
297- ```
298- flatpak install flathub org.freedesktop.appstream-glib
299- flatpak run org.freedesktop.appstream-glib validate org.libvips.vipsdisp.appdata.xml
300- ```
301-
302- Also:
303-
304- ```
305- desktop-file-validate org.libvips.vipsdisp.desktop
306- ```
307-
308- ## Uploading to flathub
309-
310- Push to master on:
311-
312- https://github.com/flathub/org.libvips.vipsdisp
313-
314- then check the build status here:
315-
316- https://flathub.org/builds/#/apps/org.libvips.vipsdisp
0 commit comments