Come conoscere rapidamente la risoluzione di un'immagine?

7

Sto cercando un modo semplice e veloce per visualizzare la risoluzione di un'immagine da OS X 10.9. Attualmente, devo aprire l'immagine in Photoshop e quindi accedere a un menu per conoscere la risoluzione. Il processo è troppo lento quando devo sfogliare dozzine di immagini e ottenere quelle con una risoluzione abbastanza grande.

    
posta Colas 11.02.2015 - 11:14
fonte

4 risposte

6

Ottieni informazioni

Puoi ottenere la risoluzione dal menu Ottieni informazioni . Seleziona l'immagine e premi ⌘ CMD + i , oppure fai clic con il pulsante destro del mouse sull'immagine e scegli la voce di menu Ottieni informazioni .

Immagineda cultofmac.com

Plugin QuickLook

Se non eri in 10.9 - questo leggero plug-in QuickLook chiamato qlImageSize che può essere trovato su GitHub consente di controllare le dimensioni dell'immagine sul titolo della finestra di quicklook. Non ho alcun lavoro su 10.9, ma forse questo ti aiuterà se desideri cercare uno simile o segnalare la compatibilità 10.9 a quel progetto per il miglioramento.

    
risposta data 11.02.2015 - 11:26
fonte
2

Dalla riga di comando se hai installato imagemagick (ad esempio attraverso homebrew o installer ), quindi è possibile utilizzare il seguente comando per visualizzare rapidamente la risoluzione e informazioni simili di più immagini in una directory:

$ ls
a.jpg
b.png
c.png
$ identify *
a.jpg JPEG 550x309 550x309+0+0 8-bit sRGB 29.4KB 0.000u 0:00.000
b.png[1] PNG 1912x827 1912x827+0+0 8-bit sRGB 2.17MB 0.000u 0:00.009
c.png[2] PNG 311x262 311x262+0+0 8-bit sRGB 185KB 0.000u 0:00.000

O se hai solo bisogno della risoluzione:

$ identify * | cut -d' ' -f1,3
a.jpg 550x309
b.png[1] 1912x827
c.png[2] 311x262

Specificando -verbose otterrai informazioni ancora più rapide che puoi grep nel caso sia necessario:

$ identify -verbose c.png
Image: c.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 311x262+0+0
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 154.515 (0.60594)
      standard deviation: 66.9006 (0.262355)
      kurtosis: -0.83131
      skewness: -0.468887
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 148.544 (0.582527)
      standard deviation: 77.5386 (0.304073)
      kurtosis: -1.18136
      skewness: -0.438364
    Blue:
      min: 27 (0.105882)
      max: 255 (1)
      mean: 176.548 (0.692343)
      standard deviation: 62.2995 (0.244312)
      kurtosis: -0.971188
      skewness: -0.584194
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 159.869 (0.626937)
      standard deviation: 69.2078 (0.271403)
      kurtosis: -0.754397
      skewness: -0.568073
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 311x262+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2015-02-11T15:20:41+00:00
    date:modify: 2015-01-28T10:04:15+00:00
    png:iCCP: chunk was found
    png:IHDR.bit-depth-orig: 8
    png:IHDR.bit_depth: 8
    png:IHDR.color-type-orig: 2
    png:IHDR.color_type: 2 (Truecolor)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height: 311, 262
    signature: 35b3a0e9c50c785bece1ceff5a202823922cc78c2740cf9e0ff30d6143c89fdf
  Profiles:
    Profile-icc: 3276 bytes
  Artifacts:
    filename: c.png
    verbose: true
  Tainted: False
  Filesize: 185KB
  Number pixels: 81.5K
  Pixels per second: 2.716MB
  User time: 0.000u
  Elapsed time: 0:01.029
  Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-05-12 http://www.imagemagick.org
    
risposta data 11.02.2015 - 15:50
fonte
2

Il modo più veloce è di avere i dettagli della risoluzione sempre visibili;)

Dai un'occhiata al seguente passaggio:

Seleziona"Mostra opzioni di visualizzazione" facendo clic con il tasto destro sul desktop

Seleziona la casella

* COLUMN VIEW

    
risposta data 16.02.2015 - 22:05
fonte
0

Questo è un compito banale. Ho scritto un programma c ++ che può essere visualizzato sul terminale. Potrei postare se sei interessato. Sarebbe anche banale scrivere un Service per visualizzare il risultato.

//
//  Display  Comment, size of JPEG image
//

#include <iostream>
#include "../jpeg.h"

int main (int argc, const char * argv[])
{
    Cjpeg Jpeg1;

    switch(Jpeg1.OpenJpeg(argv[1]))
    {
        case INVALID_JPEG:
            std::cerr << "Invalid JPEG" << std::endl;
            return INVALID_JPEG;
        case NOTFOUND_JPEG:
            std::cerr << "File Not Found" << std::endl;
            return NOTFOUND_JPEG;
        case NOT_JPEG:
            std::cerr << "Not JPEG" << std::endl;
            return NOT_JPEG;
        default:
            std::cout << Jpeg1.Comments <<  " " <<  Jpeg1.Width <<  " * "  <<  Jpeg1.Height << std::endl;
    }
    return 0;
}

// jpeg.cpp: implementation of the Cjpeg class.
// ANSI version
//////////////////////////////////////////////////////////////////////

#include "jpeg.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Cjpeg::Cjpeg()
{
    Height = Width = 0;
    Comments[0] = '
//
//  Display  Comment, size of JPEG image
//

#include <iostream>
#include "../jpeg.h"

int main (int argc, const char * argv[])
{
    Cjpeg Jpeg1;

    switch(Jpeg1.OpenJpeg(argv[1]))
    {
        case INVALID_JPEG:
            std::cerr << "Invalid JPEG" << std::endl;
            return INVALID_JPEG;
        case NOTFOUND_JPEG:
            std::cerr << "File Not Found" << std::endl;
            return NOTFOUND_JPEG;
        case NOT_JPEG:
            std::cerr << "Not JPEG" << std::endl;
            return NOT_JPEG;
        default:
            std::cout << Jpeg1.Comments <<  " " <<  Jpeg1.Width <<  " * "  <<  Jpeg1.Height << std::endl;
    }
    return 0;
}

// jpeg.cpp: implementation of the Cjpeg class.
// ANSI version
//////////////////////////////////////////////////////////////////////

#include "jpeg.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Cjpeg::Cjpeg()
{
    Height = Width = 0;
    Comments[0] = '%pre%';
}

Cjpeg::~Cjpeg()
{

}

//--------------------------------------------------------------------------
// JPEG markers consist of one or more 0xFF bytes, followed by a marker
// code byte (which is not an FF).
//--------------------------------------------------------------------------

#define M_SOF0  0xC0            // Start Of Frame N
#define M_SOF1  0xC1            // N indicates which compression process
#define M_SOF2  0xC2            // Only SOF0-SOF2 are now in common use
#define M_SOF3  0xC3
#define M_SOF5  0xC5            // NB: codes C4 and CC are NOT SOF markers
#define M_SOF6  0xC6
#define M_SOF7  0xC7
#define M_SOF9  0xC9
#define M_SOF10 0xCA
#define M_SOF11 0xCB
#define M_SOF13 0xCD
#define M_SOF14 0xCE
#define M_SOF15 0xCF
#define M_SOI   0xD8            // Start Of Image (beginning of datastream)
#define M_EOI   0xD9            // End Of Image (end of datastream)
#define M_SOS   0xDA            // Start Of Scan (begins compressed data)
#define M_JFIF  0xE0            // Jfif marker
#define M_APP1  0xE1            // Exif marker
#define M_COM   0xFE            // COMment
#define M_DQT   0xDB
#define M_DHT   0xC4
#define M_DRI   0xDD

// Process a SOFn marker
void Cjpeg::process_SOF (unsigned length)
{
    int data_precision, num_components;
    unsigned char Data[128];
    unsigned long   cb; // count of bytes read

    cb = fread(&Data, 1, length, fp);   // read JPEG

    data_precision = Data[0];
    Height = Get16(Data+1);
    Width = Get16(Data+3);
    num_components = Data[5];
}

// Process a COM marker.
void Cjpeg::process_COM (unsigned length)
{
    unsigned nch;
    unsigned long   cb; // count of bytes read

    nch = 0;

    nch = (length > MAX_COMMENT) ? MAX_COMMENT : length;    // Truncate if it won't fit in our structure.
    cb = fread(&Comments, 1, nch, fp);  // read JPEG

    Comments[nch] = '%pre%'; // Null terminate
    if(cb<length)
    {
        fseek(fp, length - cb, SEEK_CUR);   // point to next JPEG marker
    }
}


void Cjpeg::process_APP1(unsigned int length)
{
    fseek(fp, length, SEEK_CUR);    // point to next JPEG marker
}


int Cjpeg::OpenJpeg(const char *JpegFile)
{
    int count;
    unsigned long   cb; // count of bytes read

    fp = fopen(JpegFile, "rb");
    if(fp == NULL)
    {
        return NOTFOUND_JPEG;
    }
    cb = fread(&JpegMarker, 2, 1, fp);  // read JPEG
    if(JpegMarker[0] != 0xFF || JpegMarker[1] != M_SOI)
    {
        fclose(fp);
        return NOT_JPEG;    // Not JPEG File
    }
    while(cb != 0) // Stop if EOF reached
    {
        cb = fread(&JpegMarker, 2, 1, fp);  // read JPEG marker
        if(JpegMarker[0] != 0xFF)
        {
            fclose(fp);
            return INVALID_JPEG;    // Invalid File
        }
        switch(JpegMarker[1])
        {
            case M_SOS: // stop before hitting compressed data
            case M_EOI: // in case it's a table only JPEG stream
                fclose(fp);
                return 0;   // Normal exit
        }
        cb = fread(&JpegSecCount, 2, 1, fp);    // read length of field
        count = Get16(JpegSecCount);
        count -= 2; // value includes length bytes
        switch(JpegMarker[1])
        {
            case M_COM: // Comment section
                process_COM (count);
                break;

            case M_SOF0:
            case M_SOF1:
            case M_SOF2:
                process_SOF (count);
                break;

            case M_APP1:
                process_APP1 (count);
                break;

            case M_JFIF:

            default:
                // Skip any other sections.
                fseek(fp, count, SEEK_CUR); // point to next JPEG marker
                break;
        }
    }
    fclose(fp);
    return INVALID_JPEG;    // Possible Invalid File
}
'; } Cjpeg::~Cjpeg() { } //-------------------------------------------------------------------------- // JPEG markers consist of one or more 0xFF bytes, followed by a marker // code byte (which is not an FF). //-------------------------------------------------------------------------- #define M_SOF0 0xC0 // Start Of Frame N #define M_SOF1 0xC1 // N indicates which compression process #define M_SOF2 0xC2 // Only SOF0-SOF2 are now in common use #define M_SOF3 0xC3 #define M_SOF5 0xC5 // NB: codes C4 and CC are NOT SOF markers #define M_SOF6 0xC6 #define M_SOF7 0xC7 #define M_SOF9 0xC9 #define M_SOF10 0xCA #define M_SOF11 0xCB #define M_SOF13 0xCD #define M_SOF14 0xCE #define M_SOF15 0xCF #define M_SOI 0xD8 // Start Of Image (beginning of datastream) #define M_EOI 0xD9 // End Of Image (end of datastream) #define M_SOS 0xDA // Start Of Scan (begins compressed data) #define M_JFIF 0xE0 // Jfif marker #define M_APP1 0xE1 // Exif marker #define M_COM 0xFE // COMment #define M_DQT 0xDB #define M_DHT 0xC4 #define M_DRI 0xDD // Process a SOFn marker void Cjpeg::process_SOF (unsigned length) { int data_precision, num_components; unsigned char Data[128]; unsigned long cb; // count of bytes read cb = fread(&Data, 1, length, fp); // read JPEG data_precision = Data[0]; Height = Get16(Data+1); Width = Get16(Data+3); num_components = Data[5]; } // Process a COM marker. void Cjpeg::process_COM (unsigned length) { unsigned nch; unsigned long cb; // count of bytes read nch = 0; nch = (length > MAX_COMMENT) ? MAX_COMMENT : length; // Truncate if it won't fit in our structure. cb = fread(&Comments, 1, nch, fp); // read JPEG Comments[nch] = '%pre%'; // Null terminate if(cb<length) { fseek(fp, length - cb, SEEK_CUR); // point to next JPEG marker } } void Cjpeg::process_APP1(unsigned int length) { fseek(fp, length, SEEK_CUR); // point to next JPEG marker } int Cjpeg::OpenJpeg(const char *JpegFile) { int count; unsigned long cb; // count of bytes read fp = fopen(JpegFile, "rb"); if(fp == NULL) { return NOTFOUND_JPEG; } cb = fread(&JpegMarker, 2, 1, fp); // read JPEG if(JpegMarker[0] != 0xFF || JpegMarker[1] != M_SOI) { fclose(fp); return NOT_JPEG; // Not JPEG File } while(cb != 0) // Stop if EOF reached { cb = fread(&JpegMarker, 2, 1, fp); // read JPEG marker if(JpegMarker[0] != 0xFF) { fclose(fp); return INVALID_JPEG; // Invalid File } switch(JpegMarker[1]) { case M_SOS: // stop before hitting compressed data case M_EOI: // in case it's a table only JPEG stream fclose(fp); return 0; // Normal exit } cb = fread(&JpegSecCount, 2, 1, fp); // read length of field count = Get16(JpegSecCount); count -= 2; // value includes length bytes switch(JpegMarker[1]) { case M_COM: // Comment section process_COM (count); break; case M_SOF0: case M_SOF1: case M_SOF2: process_SOF (count); break; case M_APP1: process_APP1 (count); break; case M_JFIF: default: // Skip any other sections. fseek(fp, count, SEEK_CUR); // point to next JPEG marker break; } } fclose(fp); return INVALID_JPEG; // Possible Invalid File }
    
risposta data 11.02.2015 - 11:50
fonte

Leggi altre domande sui tag