Code Monkey home page Code Monkey logo

bluescan / tacentview Goto Github PK

View Code? Open in Web Editor NEW
288.0 6.0 29.0 296.47 MB

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tif, ico, webp, and bmp files. Uses Dear ImGui, OpenGL, and Tacent. Useful for game devs as it displays information like the presence of an alpha channel and querying specific pixels for their colour.

License: ISC License

C++ 100.00%
exr dear-imgui hdr dds image-viewer webp gif ktx ktx2 crop image image-processing qoi apng astc bmp jpg png tga tiff

tacentview's Introduction

Build latest tacentview

tacent view

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tiff, ico, webp, and bmp files. Built on DearImGui and the Tacent library, the viewer has robust support for pixel-formats used during game/mobile development including BC1-7, ASTC and ETC. Editing functionality includes batch-resizing, rotations/flips, contact-sheet/flipbook generation, cropping, levels adjustments, etc. Tacent View can save tga, png, bmp, qoi, jpg, (animated) webp, (animated) gif, (animated) apng, and (animated) tiff files.

As a photo viewer it can handle large collections and generate/retrieve thumbnails very quickly. The slideshow mode can display photos in any order, including fields stored in the EXIF meta-data of jpeg files (like latitude, or aperture, etc).

Tacent View may also be used as a command-line tool for batch processing of images or integration into build-pipelines. All operations that can be done in the GUI are also available from the command-line -- colour quantization, crop, rotate, frame-extraction, resize, etc.

Tacent View Homepage

GUI Overview

CLI Overview

Tacent View runs on Windows (10 or 11) and Linux (Kubuntu etc). Browse the releases to grab a zip (Windows) or deb (Linux) package -- or install from the Snap Store.

Here is an example of adjusting levels using Tacent View. All frames of animated images can be adjusted at once, or each frame can be done individually. All operations support a per-image undo/redo stack. Tacent View Levels

And grabbling the exact pixel colour value to the clipboard. Tacent View

Left/right direction keys show previous and next images, semi-transparent images are displayed with an optional checkerboard background, and images may be converted to different formats easily. Tacent View

Use 'Save All As..." to batch convert all the images in a folder. Tacent View

Viewing as thumbnails is supported by the 'Thumbnail View' window. Thumbnail generation and cache retrieval are extremely fast. Tacent View can easily handle thousands of photos in a single folder. Tacent View

Contact sheet (AKA flipbook) textures may be generated. Images may be 'played' in succession to see what they look like animated. The alpha-channel is interpreted as opacity and is properly processed if the source images have semi-transparency. Tacent View

Flip, rotate-by-90-degrees, rotate-arbitrarily (with live preview), cropping, and viewing textures in tiled mode is supported. There are also some powerful tools to resize images either by resampling or adjusting the canvas size. The 'aspect' mode in resize-canvas is useful for changing a photo's aspect ratio without any non-uniform scale. You get to set the anchor and choose whether you want the image letter-boxed or cropped. The border removal tool finds all matching pixels around the edges of an image and crops them. All edit operations are backed by a full undo (ctrl-z) and redo (ctrl-y) stack. Tacent View

Tacent View

When viewing dds, ktx, or ktx2 files, you can view any present mipmaps and see cubemaps in a 'T' layout. Tacent View

Tacent View

Users may zoom using Ctrl+/- and pan using the right mouse button. Several zoom modes are availabe in the view-menu including Fit, Downscale, and One-to-One pixel mapping. On extreme zooms the selected pixel is drawn with an outline. Tacent View

High Definition Image loading is supported for exr, hdr (rgbe), dds, ktx and ktx2 files. For hdr/rgbe files the loading code is based on, and is functionally equivalent to, the reference code from the Radiance imaging toolset. Adjustments to gamma correction and exposure are supported when loading any HDR file. The images below (Copyright Rafal Mantiuk under Creative Commons 3.0) show an image that loads over-exposed and is subsequentially adjusted to yield a more balanced result. HDR Loading

EXR support uses reference code from OpenEXR and should be able to load most exr files, including multi-frame (AKA multi-part) files. There is control for various exr parameters including the ability to de-fog. The screenshot below ('desk' image courtesy OpenEXR and under their licence) shows similar successive exposure adjustments. EXR Loading

Other formats store multiple images inside a single file. A dds or ktx may be a cubemap with 6 sides or a BC/ASTC compressed image with mipmaps. A tiff may also include multiple 'pages'. Webp and png/apng files may be animated. For these formats the property-editor window allows you to display which frame you see. The hypercube below (courtesy Jason Hise under CC0) shows the options and play controls for a multi-frame animated gif. In Tacent View the duration of any individual frame may be edited and the file resaved. This works whether a gif, apng or webp is being edited. AnimGif

Alt-Enter toggles fullscreen mode. In this mode the bottom navigation bar and top menu are invisible. If at any point you want to reset the UI or other settings like the default resample algorithm or preferred file save format, you may do so from the preferences dialog. Tacent View

The 'transparent work area' option in the preferences allows you to see right through to your desktop -- interpreting the alpha channel in the image, if present, as opacity. If you set the viewer to basic-mode (B-key, no UI widgets), and enter fullscreen mode (Alt-Enter), you can do things like play animated semitransparent webp file right over your desktop. The screenshot below shows transparent-work-area turned on while in windowed (non-fullscreen) mode. This works in both Linux and Windows. For Linux, the snap system disables this feature so you will need to install the deb file or build from source. Tacent View

building from source

For convenience pre-built binaries are available for Windows and Ubuntu/Debian in the Releases section. Other Linuxes can use the Snap Store Release. Follow the instructions below to build from source.

windows

Building on Windows is tested with the Visual Studio 2022 MSVC compiler (choose the C++ workflow when installing). You will need to install git. Optionally you may want to use VSCode with the CMake Tools extension to build. To build from the Visual Studio x64 Command Prompt:

mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -Ax64
cmake --build . --config Release --target install

The install target will also package a zip file with all required content. This is done by an install step using a powershell script.

ubuntu

Building for Ubuntu is tested with Clang 13 and GCC 11.2 (and is known to work with more recent releases). CMake and Git are required. Ninja is suggested but optional. The 'Software and Updates' app allows you to manage (add and remove) repositories or use the command line:

sudo apt-get install gdebi               # Installs gdebi to allow command-line deb file installation. Optional.
sudo apt-get install git                 # Install git or download the source as a zip.
sudo gdebi Downloads/smartgit-19_1_7.deb # Install smartgit or some other git frontend. Optional.
sudo apt-get install llvm                # The compiler. Optional if not using GCC.
sudo apt-get install clang               # The compiler. Optional if not using GCC.
sudo apt-get install lldb                # The debugger. Optional if not using GCC.
sudo apt-get install cmake               # CMake.
sudo apt-get install ninja-build         # Ninja build system.
sudo update-alternatives --config c++    # Choose clang. Optional if not using GCC.
sudo update-alternatives --config cc     # Choose clang. Optional if not using GCC.

I usually use VSCode with the CMake Tools to build. Alternatively from the command line:

mkdir ninjabuild
cd ninjabuild
cmake .. -GNinja
ninja install

You can pass -DCMAKE_BUILD_TYPE=Debug (or Release) to cmake if so desired. The install target places the viewer into a ViewerInstall directory along with any data resources it needs. Install is also leveraged to build packages. If you configure and build with:

cmake .. -GNinja -DPACKAGE_DEB=True
ninja install

Then a deb file with all required content will be generated.

Credit and Thanks

This project relies on myriad 3rd-party libraries. In the Data folder you will find their licences. Some of the more notable dependencies are listed here:

  • Dear ImGui
  • GLAD
  • GLFW
  • Ico Load
  • Ion Icons
  • Roboto Font
  • LibJPeg-Turbo
  • LibTIFF
  • OpenEXR
  • ZLib
  • GIF Load
  • gifenc
  • WebP Reference Library
  • LibPNG
  • LibKTX (KTX-Software)
  • APNGDis and APNGAsm
  • TinyXML2
  • TinyEXIF
  • BCDec from iOrange
  • QOI from phoboslab
  • ASTCDec from ARM
  • This software is based in part on the work of the Independent JPEG Group.
  • This software includes Radiance software developed by the Lawrence Berkeley National Laboratory.

Various development tools available for open source projects bear mentioning:

  • CMake
  • Kubuntu
  • VS Code Editor
  • Visual Studio Community
  • GCC, Clang, and the MSVC Compiler
  • Github
  • Git and the SmartGit Client
  • OpenGL, GLAD, and GLFW
  • NVidia Texture Tools Exporter

tacentview's People

Contributors

bluescan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tacentview's Issues

The first frame of animated gifs with transparency contains uninitialized (garbage) pixels

Unsure if this is the correct project to report this bug, but the problem is that transparent pixels are allocated, but never initialised to any value for the first frame in a gif file. This can be fixed by inserting the line
memset(FrmPict, 0, Width * Height * sizeof(tPixel));
at line 47 of tImageGif.cpp.

Incorrect, garbage background:
garbage

Correct, clean background:
fixed

[Bug] Filename encoding problems

Tacent won't open file if it has Cyrillic letter (it opens with blank window).
try rename a file to ั‹.png

Tacent title bar incorrectly display filenames with chars that not English.
image

The DDS property editor need some changing

Only the option to display layers one-by-one would be needed here.
image
image

Maybe also move the 'Display Mipmaps' and 'Display Cubemap' buttons to the DDS property editor window since it's the only image type that uses these options and add an option to enable them by default.

Orig intended for editing properties. Need to think about this one a bit. Point taken that only DDS files support mipmaps and cubemaps so why clutter the toolbar. As for the frame duration, agreed it should not be there for, say, DDS files... not sure for other 'non-animated' image types. Tiff, for example, can store multiple 'pages' (images)... and they could be used for flipbook anim. In fact, that frame duration field does actually set the value -- so you can adjust, for example, how long each frame takes and if you save as a gif, apng, etc, it will write that duration out. For tiff files it uses a custom (user) field for the duration, so if you reopen in tacentview, you will see it play with the saved duration for each frame.

Hmm, I wasn't aware tiff files could be used like this, it's interesting. I'll let you see how to handle this dialog, and I'll be happy to provide more feedback if needed!

[Suggestion] A keybind window

The option to rebind keys would be nice (and not all features have a keybind assigned to them currently). Maybe also add a key hint to the icons when hovering them as well?

Can put on list. It's a bit of work.

I am aware, this is kind of a luxury right now, take your time!

[Suggestion] Restore Maximized/Fullscreen view states

Currently only window size is restored.

If I maximize window, quit, open again, the size will be correct (looks like maximized), but window is not truly maximized.

I prefer to have a fullscreen view from the start, and I set q keybind for quick exit.

[Suggestion] Support for non-US keyboards

Now, I know this is a common issue with GLFW and ImGUI programs, but there are have been several workarounds posted to the ImGUI and GLFW issue trackers. I managed to make it work using a slightly 'dirty' method, but it would be nice to have this change made upstream.

I don't own any...although I'm sure you can set the OS to interpret the scancodes as if it were a different layout. If you have code (messy or not), it could be attached to this issue (after a sep bug is made for it).

        // Convert key codes to support non-US keyboards
        const char* keyName = glfwGetKeyName(key, 0);
        if (keyName)
        {
        	key = static_cast<int>(static_cast<unsigned char>(keyName[0]));

		// Convert to upper-case
		if (key >= 97 && key <= 122)
			key -= 32;
        }

Adding this block of code just before the 'key' switch statement in 'KeyCallback()' seems to do the trick for AZERTY (need testing for other layouts such as QWERTZ). I also don't know if it has an impact on performance (probably not since it's a very small operation, but who knows).
If this solution works out I feel like it's better than having the user change things in their OS as the vast majority of programs support different layouts natively (it seems to be a shortcoming on GLFW and ImGUI's side).

Cache thumbnails

Yes, I'm using the issue tracker as my to-do list. Thumbnails need to be cached. Will use the tHash functions.

[Suggestion] Option to reset the zoom when switching image

Pretty self-explanatory, navigating through folders with images of multiples sizes can get a bit messy because of that. Maybe put a 'default zoom mode' option in the preferences would fix that? Since zooming in or out resets it to 'Zoom user'.

Yup. Agree.

[Suggestion] Option to close the program with 'Escape'

Some other image viewers have this feature (and sometimes by default), and I think it helps speeding up the workflow when going through multiple pictures.

Sure. FYI Alt-F4 currently works.

I am aware of Alt-F4 but using only one button compared to having to cramp my hand for two quite far apart button feels better IMO.

No Issue - just thanks ;)

Just spend way too long looking for a HDR viewer, eventually came to github and found your release.

All I needed was a quick way to see my HDR's to decide which to import into Blender, the Content View is ideal for me.

So just thanks for doing whatever it is you do. It's appreciated.

Kind Regards TT

[Suggestion] Multiple small suggestions

Hello, first of I want to thank you for providing this great image viewer! I always struggled to find one that fitted my needs as well as this one does.

After using it for a bit, I want to make a couple of suggestions on how to improve the program even further (or at least put them as options and sorry if some of them have already been suggested!). I am running on Linux:

  • Zooming the image doesn't take up the entire workspace:

image
image
I don't know if this is deliberate, but I think it looks weird. The 'zooming area' seems to keep the image aspect ratio.

  • Option to reset the zoom when switching image:

Pretty self-explanatory, navigating through folders with images of multiples sizes can get a bit messy because of that. Maybe put a 'default zoom mode' option in the preferences would fix that? Since zooming in or out resets it to 'Zoom user'.

  • Option to close the program with 'Escape':

Some other image viewers have this feature (and sometimes by default), and I think it helps speeding up the workflow when going through multiple pictures.

  • Support for non-US keyboards:

Now, I know this is a common issue with GLFW and ImGUI programs, but there are have been several workarounds posted to the ImGUI and GLFW issue trackers. I managed to make it work using a slightly 'dirty' method, but it would be nice to have this change made upstream.

  • 'Basic View' mode doesn't restore the interface and settings as they were:

For example, when I exit 'Basic View', the 'Nav bar' disappears and the 'Auto Property Window' setting gets disabled. I don't really like that.

  • The DDS property editor is the same as the one for animated pictures:

Only the option to display layers one-by-one would be needed here.
image
image

  • Option to enable 'Display Mipmaps' and 'Display Cubemap' by default when viewing DDS files:

Maybe also move those buttons to the DDS property editor window since it's the only image type that uses these options.

  • A keybind window:

The option to rebind keys would be nice (and not all features have a keybind assigned to them currently). Maybe also add a key hint to the icons when hovering them as well?

  • Add separators between icons:

Right now, all the icons are all just lined up next to each other and not necessarily grouped by functions. Adding separators and grouping the icons in a more sensible way will make the menu bar easier to navigate.

  • Option to scale the UI / make the font bigger:

This is just for accessibility reasons and for people with bigger / smaller monitors.



I think this is everything that I wanted to say for now. None of these issues are a deal breaker by any means! But it would make the program feel even better to use this way in my opinion.

Better batch options.

jpg slider quality control needed.
Modes should include

  • Keep same size
  • Resize (does WH)
  • Width (force all images to specified width. Keep aspect ratio.
  • Height " " "
  • Percent (of original ... both W and H.

32bit binaries

Hi, please make binaries for win32, I would like try this image viewer, looks really good, however is a shame if avaible just for 64bit systems.

Shift Delete

Bring up a popup same way as regular delete, except do not try to use the recycle bin, Warn user.

Preferences tabs

The reset behaviour and interface buttons need to go. There should be a separate reset button for each tab that only affects that tab.

Animated GIFs

Make the AltImage picture a list of pictures. Cximage can already load the frames. Note that frame-delay is in ms in a gif.

Manage supported extensions instead of hardcoding.

The file dialog currently has the extension filter hardcoded. May need functionality in tacent to go from filetype back to associated extensions. Add 'CanLoad' (os maybe 'GetLoadableExtensions') and 'CanSave' (or GetSaveableExtensions) to the Image class (similar to tPicture).

Then will need to generate the filter from the functions above.

[Suggestion] Add separators between icons

Right now, all the icons are all just lined up next to each other and not necessarily grouped by functions. Adding separators and grouping the icons in a more sensible way will make the menu bar easier to navigate.

Agreed.

Images are incorrectly centered at some window sizes

Small images appear blurry at some window sizes because the image centering logic at TacentView.cpp line 975 is incorrect. This can be fixed by replacing the block with the following:

float offsetW = tMath::tRound((draww - w) / 2.0f);
left	+= offsetW;
right	= left+w;

float offsetH = tMath::tRound((drawh - h) / 2.0f);
bottom	+= offsetH;
top		= bottom+h;

Blurry, incorrect:
blurry
Clear, correct:
correct

Generation of targa contact sheets

Currently generation of a tga contact sheet can generates a 32 bit image even if all source images are fully opaque. In this case it should generate a 24 bit targa.

Nav bar update

If you create a contact sheet in a subfolder that doesn't yet exist, the nav bar will not be updated to show a dropdown for the subfolder. You need to go up a level first.

[Suggestion] Option to scale the UI / make the font bigger

This is just for accessibility reasons and for people with bigger / smaller monitors.

Also a bit of work... cuz I know there are at least some hardcoded offsets etc for some of the UI widgets/controls.

I haven't looked at a way to solve this either... Probably will be complicated as you say

Generate thumbnails on separate threads

We need to be able to open folders with 1000s of photos. Thumbnail gen is too slow to allow it to block the main thread. Plan is to use non-locking atomic bool (bit-set-and-test) for synchronization.

Set monitor gamma in saved settings.

If you know your monitor gamma, we should store it in the settings where it is saved. Gamma correction is, optionally, used by the hdr formats (.hdr and .exr). Set gamma to 1 is you want linear colours pushed out to your monitor. Set default to 2.2.

Implement proper multi-monitor support for both platforms.

Hi,
I recently got a dual monitor setup and noticed an annoying bug on Linux with KDE, the window always appear on the left-most monitor (which is my 2nd screen for me)

I actually identified the cause: before loading the window settings, the program clamps the position value, but it doesn't take into account that the origin point shift to the left-most point in a multi-monitor setup on Linux (at least on X11, I didn't test Windows or Wayland)

If the intent was to prevent the window from spawning out-of-bounds, it is unnecessary because this is done automatically (either by GLFW or X11, I don't know). It also does it for the size

Thank you again for the program!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.