thumbspage — Turn Folders into HTML Image Galleries
This Python program builds web pages for user-friendly viewing of all the images in a folder. Its results do not require a web server and can be viewed in any desktop or mobile browser, both offline and online. They may also be easily customized and can be enhanced with notes when it's useful to narrate your pictures. As such, thumbspage makes general image galleries, useful in a wide variety of contexts, including documentation, photo sharing, and regular viewing.
Click this page's images for quick live demos. Its contents:
— the elevator summary
— installs, platforms, releases
— demos, docs, code
— package fetch and browse
thumbspage allows you to view or display a folder of photos and other images in a web browser, in a format that's both simple and noticeably better than browser defaults.
The thumbspage script automatically generates all the scaffolding needed to make this work. Given an image-files folder, along with any gallery options you choose to provide, it builds:
Thumbnail
of any
An HTML
page in one of
And one HTML
page
When clicked or tapped, thumbnails on the index page open viewer pages by default but can also open browser-native
. The index page may also include bullet links to nested
in the images folder. Viewer pages in turn show the full-size image, automatically
to the display. They also come with navigation links,
and
toggles, and
and
popups, and support
on touch displays, touch pads, and mice.
Run parameters—image-folder path, thumbs per row, thumbs max size, and viewer-pages option—may be input interactively in the
or provided by
or
. For more control, custom HTML
and
sections for the index page can be provided in the images folder;
and much more can be customized in the
or command-line
; and the program's page
may be changed as desired.
The generated index page, along with a subfolder containing thumbnail images and generated viewer pages, are created in the images folder itself. Open the generated index page there (index.html by default) to view results, and package the complete images folder to publish (e.g., copy it into your product, or zip and upload it to your website). For automation ideas, see
and the demos'
and
scripts.
This program uses and requires
, plus the 3rd-party
image-processing library. Any platform supported by both of these systems can run thumbspage, including
,
,
, and
. For more on building galleries, see the creators section of the
.
The pages this program creates use a portable combination of HTML, CSS, and JavaScript, and work on all commonly used desktop and mobile browsers. Any recent version of Chrome, Firefox, Safari, Edge, and Internet Explorer should suffice—including the more than 12 tested among
,
, and
, and the 10+ tested across
and
. For more on viewing galleries, see the consumers section of the
.
thumbspage has been actively developed since its 2016 inception. Its recent
have added:
[3.0] Omitted filename
, end-of-gallery indicators and
, swipe gestures on touchpads and mousewheels too, embedded HTML tags and entities in
, keypresses where available, raw-view
, explicit ordering and
, and a precoded dark
[2.3] Optional per-image
, via toolbar
, up-swipes on touch, and plain-text note files; along with console-input config
, enhanced
, thumbs-only index
, and
[2.2] Support for image
on mobile and PC touch displays, configuration via command-line
as an alternative to file edits, and optional
[2.1] Configurable thumbnail-image
that reduce compression noise and resize
; a dynamic index-page layout
; automated
; and
[2.0] Automatic
, one-page
, and custom info
for viewer pages; floating
for index pages; styling to handle page
; and
[1.7] Image-info
, large-font
, better GIF
, Exif-tag updates on
, easier builds on
, improved scaling for iOS
, and
[1.6] Both
for tilted images and their thumbs, and JavaScript-based dynamic
for viewer pages (though pages still function
)
[1.5 to 1.3] Optional viewer pages for custom
; improved styling and
; full
thumbspage is used for all the galleries on this website (roughly 50 at last count) and comes with complete usage examples, in-program documentation, and a comprehensive HTML User Guide with information for both gallery viewers and builders. See the resources listed below for more details.
If you prefer to learn by example, study the 3.0
as well as others
and
. For illustration, these demos use custom headers and settings, which you don't need to code if the
work for your galleries. Demos labeled with (notes) ahead have 2.3+ image
.
The Docs
— brief usage info reflecting the latest 3.0 release
— the full story for creators and consumers
The Code
— main script: run this to make galleries (2258
)
— Python-expanded HTML+CSS+JavaScript (2668 lines)
— Python-expanded HTML+CSS+JavaScript (75 lines)
— Python-expanded CSS (96 lines)
— image thumbnails and rotations, from
(887 lines)
— Python-coded configuration options (1098 lines)
Clients
— the initial use case, and a 3.0 demo
— program examples get a fresh look
— with custom colors and fonts
,
,
,
,
— Android demos
,
,
,
,
— app screenshots
— Play-store sync app (off-site)
— Play-store calendar app (off-site)
Packaged
and
for the latest 3.0 release
,
,
,
,
— recently added features
— 2.1's index-page alternative
— auto-reorientation of tilted photos
— non-ASCII filenames and page inserts
— auto-generation of links to nested folders
— a medley of common and supported formats
— yes, thumbspage is used on itself
Collections
— how to build galleries
— the complete packaged set
thumbspage is provided as open-source and portable source code that you run with a Python installed
(for example, in Terminal on macOS and Linux, Command Prompt on Windows, or a mobile-platform app). Use the following links to either fetch thumbspage and unzip it on your computer, or view its complete unzipped content online.
Starting with 2.1, thumbspage can be downloaded in a program-only zip, which contains the complete runnable program but omits the examples folder and ships with a User Guide whose example links have all been
to open online resources. Select the first download link below to fetch this new and smaller package. Other links download the full package or just the examples, and all downloads unzip to a top-level thumbspage folder. Online versions:
,
.
Fetch and Browse
Download
— Program + User Guide (small)
— Examples only, standalone (large)
— Program + User Guide + Examples (larger)
View
— full-package zipfile content online
What's New
This program's latest version:
, August 12, 2025.
Version
extends 3.0 with a minor patch that prevents recent releases of Android Chrome from intercepting and consuming down swipes in viewer pages, where they are used for info popups. No new functionality is included in this version.
Version
adds end-of-gallery indicators, swipe gestures on touchpads and mousewheels too, embedded HTML tags and entities in notes, keypresses where available, explicit ordering and captions, a precoded dark mode, and more. 3.0 is potentially backward incompatible because it mods some preset default configurations that may impact builds and console inputs, and it recognizes HTML tags and entities escaped with a leading underscore in note text.
See also the recent-changes list
, and 3.0's release
, quick
, gallery
, and
. The final release of the prior version of thumbspage, 2.3, can be fetched in program-only form
.
Related Programs
can optimize the size of images in thumbspage galleries published online.
(in PyGadgets) is a GUI-based image viewer, which acquired thumbspage's image
as told
.
is a photo-folder organizer tool, whose results may work well as thumbspage galleries.
zips and uploads images and a non-thumbnail index page.
For more code examples, see the
page on this website.