Giter Site home page Giter Site logo

ksharindam / photoquick Goto Github PK

View Code? Open in Web Editor NEW
17.0 7.0 2.0 909 KB

Light-weight image viewer with crop,resize,collage, photogrid and filters

License: GNU General Public License v3.0

C++ 95.35% QMake 0.58% NSIS 3.02% C 0.51% Shell 0.54%
image-viewer photo-crop collage qt4 inpainting qt5

photoquick's Introduction

License Release Release Date Downloads Total Downloads Latest

PhotoQuick (for Linux and Windows)

A simple handy image viewer and editor with some useful features (Qt based).

Description

This program is aimed at ease of use, quick opening, and doing most necessary features.

  • Export to PDF
  • Auto Resize to file size
  • Crop in particular ratio
  • Rotate, mirror, perspective transform
  • Add Border
  • Create photo grid for printing
  • Magic Eraser (inpainting)
  • Intelligent Scissor
  • Filters (Scan Page, Reduce Noise, Auto Contrast, White Balance )
  • Photo Optimizer & Batch Resize
  • Plugin support

Download

Download the precompiled packages from releases page.
For Windows download .exe package and install it.
For Linux download .AppImage package, mark it executable, and double click to run.

Build (Linux)

This program supports both Qt4 and Qt5. Qt4 is not available on newer distros.
But Qt4 is preferred over Qt5.

Install dependencies...
Build dependencies ...

  • libqt4-dev or qtbase5-dev

To build this program, extract the source code zip.
Open terminal and change directory to src/
Then run these commands to compile...

qmake  
make -j4  

To install run ...
sudo make install

To uninstall, run ...
sudo make uninstall

Runtime Dependencies

  • libqtcore4 or libqt5core5a
  • libqtgui4 or libqt5gui5
  • libqt4-svg or libqt5svg5 (for svg support | optional)
  • libgomp1
  • wget (for check for updates in linux | optional)

Build (Windows)

Download Qt 4.8.7 and minGW32
Add Qt/4.8.7/bin directory and mingw32/bin directory in PATH environment variable.
In src directory open Command Line.
Run command...
qmake
make -j4

Plugins

The plugins/ directory contains only sample plugins.
Build (Linux and Windows) :
Open terminal or command line in project root directory.
Then run these commands to compile...

cd plugins  
qmake  
make -j4  

Install (Linux) :
sudo make install

Get more plugins from https://github.com/ImageProcessing-ElectronicPublications/photoquick-plugins
Also you can create your own plugins and use with it.

Usage

To run this program...
photoquick

To open image.jpg with it...
photoquick image.jpg

Keyboard Shortcuts

Reload Image : R
Delete Image : Delete
Copy Image : Ctrl+C

Supported Image Formats

All formats supported by Qt are supported in this program.
Read : JPG, PNG, GIF, SVG, TIFF, ICO, BMP, XPM, XBM, PPM, PBM, PGM
Write : JPG, PNG, TIFF, ICO, BMP, XPM, XBM, PPM

JPEG2000 and WebP formats are supported via image format plugins.
You can get these here...
https://github.com/ksharindam/qt-imageformat-plugins

Screenshots

Main Window
Main Window

Photo-Grid
Photo Grid

Scissor Tool
Scissor Tool

photoquick's People

Contributors

ksharindam avatar zvezdochiot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

photoquick's Issues

qimageblitz

Hi @ksharindam .

See https://sourceforge.net/projects/qimageblitz/

cat qimageblitz.h
class QIMAGEBLITZ_EXPORT Blitz
{
public:
    enum GradientType {VerticalGradient=0, HorizontalGradient, DiagonalGradient,
        CrossDiagonalGradient, PyramidGradient, RectangleGradient,
        PipeCrossGradient, EllipticGradient};

    enum RGBChannel{Grayscale=0, Brightness, Red, Green, Blue, Alpha, All};
    enum EffectQuality{Low=0, High};

    enum ScaleFilterType{UndefinedFilter=0, PointFilter, BoxFilter,
        TriangleFilter, HermiteFilter, HanningFilter, HammingFilter,
        BlackmanFilter, GaussianFilter, QuadraticFilter, CubicFilter,
        CatromFilter, MitchellFilter, LanczosFilter, BesselFilter,
        SincFilter};

    enum ModulationType{Intensity=0, Saturation, HueShift, Contrast};
    static bool invert(QImage &img, QImage::InvertMode mode =
                       QImage::InvertRgb);
    static bool grayscale(QImage &img, bool reduceDepth=false);
     static QImage smoothScale(QImage &img, const QSize &sz,
                              Qt::AspectRatioMode aspectRatio =
                              Qt::IgnoreAspectRatio);
    static QImage smoothScale(QImage &img, int dw, int dh,
                              Qt::AspectRatioMode aspectRatio =
                              Qt::IgnoreAspectRatio);
    static QImage smoothScaleFilter(QImage &img, const QSize &sz,
                                    float blur=1.0,
                                    ScaleFilterType filter=BlackmanFilter,
                                    Qt::AspectRatioMode aspectRatio =
                                    Qt::IgnoreAspectRatio);
    static QImage smoothScaleFilter(QImage &img, int dwX, int dwY,
                                    float blur=1.0,
                                    ScaleFilterType filter=BlackmanFilter,
                                    Qt::AspectRatioMode aspectRatio =
                                    Qt::IgnoreAspectRatio);

    static QImage convolve(QImage &img, int matrix_size, float *matrix);
    static QImage convolveInteger(QImage &img, int matrix_size, int *matrix,
                                  int divisor=0);
    static QImage blur(QImage &img, int radius=3);
    static QImage gaussianBlur(QImage &img, float radius=0.0, float sigma=1.0);
    static QImage edge(QImage &img);
    static QImage convolveEdge(QImage &img, float radius=0.0,
                               EffectQuality quality=High);
    static QImage gaussianSharpen(QImage &img, float radius=0.0, float sigma=1.0,
                                  EffectQuality quality=High);
    static QImage sharpen(QImage &img, int radius=3);
    static QImage emboss(QImage &img, float radius=0.0, float sigma=1.0,
                         EffectQuality quality=High);
    static QImage antialias(QImage &img);
    static QImage& despeckle(QImage &img);
    static QImage& contrast(QImage &img, bool sharpen, int weight=3);
    static bool equalize(QImage &img);
    static bool normalize(QImage &img);
    static QImage& intensity(QImage &img, float percent);
    static QImage& channelIntensity(QImage &img, float percent,
                                    RGBChannel channel);
    static QImage& desaturate(QImage &img, float desat = 0.5);
    static QImage& fade(QImage &img, float val, const QColor &color);
    static QImage& flatten(QImage &img, const QColor &ca, const QColor &cb);
    static QImage threshold(QImage &img, unsigned char thresholdValue=127,
                            RGBChannel channel=Grayscale,
                            unsigned int aboveColor=qRgb(255, 255, 255),
                            unsigned int belowColor=qRgb(0, 0, 0));
    static QImage swirl(QImage &img, float degrees=60.0);
    static QImage implode(QImage &img, float amount=0.3);
    static QImage wave(QImage &img, float amplitude=25.0, float frequency=150.0,
                       unsigned int background=0);
    static QImage oilPaint(QImage &img, float radius=0.0,
                           EffectQuality quality=High);
    static QImage charcoal(QImage &img);
    static QImage gradient(const QSize &size, const QColor &ca,
                           const QColor &cb, GradientType type);
    static QImage grayGradient(const QSize &size, unsigned char ca,
                               unsigned char cb, GradientType type);
    static QImage unbalancedGradient(const QSize &size, const QColor &ca,
                                     const QColor &cb, GradientType type,
                                     int xfactor=100, int yfactor=100);
    static QImage grayUnbalancedGradient(const QSize &size, unsigned char ca,
                                         unsigned char cb, GradientType type,
                                         int xfactor=100, int yfactor=100);
    static QImage& modulate(QImage &img, QImage &modImg, bool reverse,
                            ModulationType type, int factor,
                            RGBChannel channel);
};

HSV255?

Hi @ksharindam .

Maybe HSV255 colorspace?:

QRgb ColorRGBtoYCbCr (QRgb p, int direct)
{
    int Y, cb, cr, r, g, b, a;

    if (direct < 0)
    {
        Y = qRed(p);
        cb = qGreen(p);
        cr = qBlue(p);
        a = qAlpha(p);
        r = Y + 1.402f * (cr - 128);
        g = Y - 0.344136f * (cb - 128) - 0.714136f * (cr - 128);
        b = Y + 1.772f * (cb - 128);
        r = (r < 0) ? 0 : (r < 255) ? r : 255;
        g = (g < 0) ? 0 : (g < 255) ? g : 255;
        b = (b < 0) ? 0 : (b < 255) ? b : 255;
        p = qRgba(r, g, b,  a);
    }
    else
    {
        r = qRed(p);
        g = qGreen(p);
        b = qBlue(p);
        a = qAlpha(p);
        Y = 0.299f  * r + 0.587f * g + 0.114f * b;
        cb = 128.0f - 0.168736f * r - 0.331264f * g + 0.5f * b;
        cr = 128.0f + 0.5f * r - 0.418688f * g - 0.081312f * b;
        Y = (Y < 0) ? 0 : (Y < 255) ? Y : 255;
        cb = (cb < 0) ? 0 : (cb < 255) ? cb : 255;
        cr = (cr < 0) ? 0 : (cr < 255) ? cr : 255;
        p = qRgba(Y, cb, cr,  a);
    }
    return p;
}

QRgb ColorRGBtoHSV255 (QRgb p, int direct)
{
    int r, g, b, h, s, v, a;
    int i, vm, va, vi, vd;
    int max = 0, min = 255;

    if (direct < 0)
    {
        h = qRed(p);
        s = qGreen(p);
        v = qBlue(p);
        a = qAlpha(p);
        r = g = b = v;
        i = (h * 6 / 255) % 6;
        vm = ((255 - s) * v + 127)/ 255;
        va = ((v - vm) * (6 * h - i * 255) + 127)/ 255;
        vi = vm + va;
        vd = v - va;
        if (s > 0)
        {
            switch (i)
            {
            default:
            case 0:
                g = vi;
                b = vm;
                break;
            case 1:
                r = vd;
                b = vm;
                break;
            case 2:
                r = vm;
                b = vi;
                break;
            case 3:
                r = vm;
                g = vd;
                break;
            case 4:
                r = vi;
                g = vm;
                break;
            case 5:
                g = vm;
                b = vd;
                break;
            }
        }
        r = (r < 0) ? 0 : (r < 255) ? r : 255;
        g = (g < 0) ? 0 : (g < 255) ? g : 255;
        b = (b < 0) ? 0 : (b < 255) ? b : 255;
        p = qRgba(r, g, b,  a);
    }
    else
    {
        r = qRed(p);
        g = qGreen(p);
        b = qBlue(p);
        a = qAlpha(p);
        max = (r < g) ? g : r;
        max = (max < b) ? b : max;
        min = (r > g) ? g : r;
        min = (min > b) ? b : min;
        h = max - min;
        if (h > 0)
        {
            if (max == r)
            {
                h = (255 * (g - b) / h + 3) / 6;
                if (h < 0)
                {
                    h += 255;
                }
            }
            else if (max == g)
            {
                h = (255 * 2 + 255 * (b - r) / h + 3) / 6;
            }
            else
            {
                h = (255 * 4 + 255 * (r - g) / h + 3) / 6;
            }
        }
        s = max - min;
        if (max > 0)
        {
            s *= 255;
            s += max / 2;
            s /= max;
        }
        v = max;
        h = (h < 0) ? 0 : (h < 255) ? h : 255;
        s = (s < 0) ? 0 : (s < 255) ? s : 255;
        v = (v < 0) ? 0 : (v < 255) ? v : 255;
        p = qRgba(h, s, v,  a);
    }
    return p;
}

Examples:
Y - R, Cb - G, Cr - B
lena ycbcr
H255 - R, S255 - G, V255 - B
lena-hsv255

Crop && (TextBox * 4)?

Hi @ksharindam .

Crop.

Interested in the possibility of replacing a Label with size indication with 4 TextBox (left, bottom, width, height) with the ability to enter values (with a check for validity)?

can not open image by relative path from command line

Hi @ksharindam

Release: https://github.com/ImageProcessing-ElectronicPublications/photoquick/releases/tag/v4.12.1
Use photoquick_4.13.1-chimaera_amd64.deb.

$ uname -a
Linux devuan-zvezdochiot 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 GNU/Linux

About:
PhotoQuick
Version: 4.13.1
Qt: 5.15.2
Plugin API: 1.0

$ photoquick lena.png 
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1971, resource id: 16622084, major code: 40 (TranslateCoords), minor code: 0

screen-20220619-1

$ photoquick /home/zvezdochiot/WORK/images/lena.png

screen-20220619-2

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.