all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* displaying images
@ 2003-01-31  2:40 Greg Hill
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Hill @ 2003-01-31  2:40 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

I used a utility program (convert, from the ImageMagick package, on a 
gnu-linux system) to create copies of a jpeg file in different sizes. 
I display them like this:

      (insert-image (create-image "rms50.jpeg") (point))

Using another utility program (display, from the same package) the 
pictures all look right.  The files also all seem to be of 
appropriate sizes.

     1259 Jan 30 18:42 rms10.jpeg
     4420 Jan 30 18:49 rms25.jpeg
   12833 Jan 30 18:49 rms50.jpeg
   13345 Jan 30 18:53 rms51.jpeg
   25729 Jan 30 18:49 rms75.jpeg
   39173 Jan 30 18:49 rms100.jpeg

The 10%, 25%, 51%, 75% and 100% scale image display properly using 
create-image and insert-image as shown above.  But the 50% scale 
image image displays the same size as the 100% image.

The 50%, 51% and 100% jpeg files are attached.

--Greg

[-- Attachment #2: rms100.jpeg.jpg --]
[-- Type: image/jpeg, Size: 39173 bytes --]

[-- Attachment #3: rms51.jpeg.jpg --]
[-- Type: image/jpeg, Size: 13345 bytes --]

[-- Attachment #4: rms50.jpeg.jpg --]
[-- Type: image/jpeg, Size: 12833 bytes --]

[-- Attachment #5: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Displaying images
@ 2023-01-15 10:35 Felix E. Klee
  2023-01-15 11:40 ` Jean Louis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Felix E. Klee @ 2023-01-15 10:35 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

I am using Emacs for file management.  This involves viewing images
either in a buffer or using `image-dired`.  All worked fine for years.
However recently:

  * There a new image formats, such as AVIF, that don’t diplay out of
    the box.

  * I bought a Sony ZV-1 digital camera, and its ARW raw images don’t
    display.  I already have an idea how to solve that, not too
    important now.

Yes, those AVIF images, why don’t they display automatically?

They are supported by the latest ImageMagick and GraphicsMagick, as
tested on my up-to-date Arch Linux system.  As example, I use:

[hato.profile0.8bpc.yuv420.no-cdef.avif][1]

My Emacs config for testing is attached.  A few minutes ago, I could
open the AVIF file, and it was displayed in `fundamental-mode`.  I had
to manually do M-x `image-mode`.  Then it displayed.  Currently that
doesn’t work at all anymore.  I am greeted by: “Unknown image type”

There are two more things that are confusing me:

  * `auto-image-file-mode` by default is `nil`, but still JPEG images,
    for example, do display.  So I don’t feel like turning it on, and it
    doesn’t seem to make a difference anyhow.  Perhaps it’s a legacy
    option.

  * In the customization buffer, for “Image Converter” it says
    “graphicsmagick” and “CHANGED outside Customize.”  Note that I start
    Emacs as `emacs -q -l init.el` with the attached init
    file.  Certainly `image-converter` is not set there.

I am using: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.36, cairo version 1.17.6) of 2023-01-03

[1]: https://aomediacodec.github.io/av1-avif/testFiles/Link-U/hato.profile0.8bpc.yuv420.no-cdef.avif

[-- Attachment #2: init.el --]
[-- Type: text/plain, Size: 803 bytes --]

(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(image-file-name-extensions
   '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg" "avif"))
 '(image-use-external-converter t)
 '(imagemagick-enabled-types t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Displaying images
  2023-01-15 10:35 Displaying images Felix E. Klee
@ 2023-01-15 11:40 ` Jean Louis
  2023-01-15 12:09   ` Emanuel Berg
  2023-01-15 19:27 ` Daniel Fleischer
  2023-01-19  9:30 ` Felix E. Klee
  2 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2023-01-15 11:40 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: help-gnu-emacs

* Felix E. Klee <felix.klee@inka.de> [2023-01-15 13:37]:
> I am using Emacs for file management.  This involves viewing images
> either in a buffer or using `image-dired`.  All worked fine for years.
> However recently:
> 
>   * There a new image formats, such as AVIF, that don’t diplay out of
>     the box.
> 
>   * I bought a Sony ZV-1 digital camera, and its ARW raw images don’t
>     display.  I already have an idea how to solve that, not too
>     important now.
> 
> Yes, those AVIF images, why don’t they display automatically?

M-x report-emacs-bug

and propose the inclusion.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Displaying images
  2023-01-15 11:40 ` Jean Louis
@ 2023-01-15 12:09   ` Emanuel Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2023-01-15 12:09 UTC (permalink / raw)
  To: help-gnu-emacs

> There a new image formats, such as AVIF, that don’t diplay
> out of the box.

Emacs displays them in-house or relays to some
external viewer?

If so (the latter) even less reason for it not to work ...

> I bought a Sony ZV-1 digital camera, and its ARW raw images
> don’t display. I already have an idea how to solve that, not
> too important now.

On the contrary, now is a good time, when you feel
enthusiastic about it!

Do it today - in a different way!

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Displaying images
  2023-01-15 10:35 Displaying images Felix E. Klee
  2023-01-15 11:40 ` Jean Louis
@ 2023-01-15 19:27 ` Daniel Fleischer
  2023-01-15 19:48   ` Felix E. Klee
  2023-01-19  9:30 ` Felix E. Klee
  2 siblings, 1 reply; 7+ messages in thread
From: Daniel Fleischer @ 2023-01-15 19:27 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: help-gnu-emacs

Felix E. Klee [2023-01-15 Sun 11:35] wrote:

>   * I bought a Sony ZV-1 digital camera, and its ARW raw images don’t
>     display.  I already have an idea how to solve that, not too
>     important now.

A few words about raw images. These are not really images but the raw
sensor data; every pixel and the amount of light it captured. There is
no color information. The color comes from filters put on top of the
image sensor. The process of converting raw photons counts into RGB
pixels is called demosaicing and is very nuanced; you can apply color
corrections, remove dead pixels, do noise reduction and the "formulas"
are specific for every file format and every camera model and sometimes
the lens used. There are specific applications that process raw images,
including open source ones. Most of the open source software use either
dcraw (CLI tool) or libraw (library). A processing step is needed to
convert the raw image into a real image (png,jpg,bmp,tiff, etc). Maybe
you can use the CLI tool for fast conversion for preview purposes. 

-- 
Daniel Fleischer



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Displaying images
  2023-01-15 19:27 ` Daniel Fleischer
@ 2023-01-15 19:48   ` Felix E. Klee
  0 siblings, 0 replies; 7+ messages in thread
From: Felix E. Klee @ 2023-01-15 19:48 UTC (permalink / raw)
  To: help-gnu-emacs

Daniel Fleischer <danflscr@gmail.com> writes:
> A few words about raw images. These are not really images but the raw
> sensor data;

:) I also like to feed them in photogrammetry software, which prefers to
have as much unprocessed info as possible.

> The color comes from filters put on top of the image sensor.

Generally yes, not with Foveon.  (regularly used a Sigma DP1x long ago)

> Maybe you can use the CLI tool for fast conversion for preview
> purposes.

All cameras that I’ve shot raw with embed a preview image into the raw
file.  It can be extracted for example with:

    dcraw -e <raw_file>

The question is how to make Emacs aware of this.  Ideally, viewing raw
images also works with [picpocket][1], a nice Emacs image viewer that I
only discovered today.

Anyhow, very nice summary of raw images!

[1]: https://melpa.org/#/picpocket




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Displaying images
  2023-01-15 10:35 Displaying images Felix E. Klee
  2023-01-15 11:40 ` Jean Louis
  2023-01-15 19:27 ` Daniel Fleischer
@ 2023-01-19  9:30 ` Felix E. Klee
  2 siblings, 0 replies; 7+ messages in thread
From: Felix E. Klee @ 2023-01-19  9:30 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

Latest update: I got the rendering of AVIF files working with
GraphicsMagick:

  * Made sure that GraphicsMagick properly reports its list of supported
    file formats.  By doing so I found what I believe to be a [bug in
    Arch][1].

  * Explicitly specified GraphicsMagick as converter, although according
    to documentation it should be chosen automatically if not set:

         '(image-converter 'graphicsmagick)

  * As before, I specified `avif` as an extension of files to render in
    `image-mode` upon loading:

        '(image-file-name-extensions
          '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" 
            "pgm" "ppm" "pnm" "svg" "avif"))

    However, that does *not* work.  AVIF files are opened in
    `fundamental-mode`, and I have to do:

        M-x image-mode

Now, I would like to try if setting `image-file-name-regexps` can solve
the issue.  However, when I add a regular expression such as simply the
four characters “avif”, then customize reports an error message:

    image-file-name-regexp: Wrong type argument: characterp, "avif"

*Why is that?  How do I properly specify a regular expression here?*

See full configuration attached.

(About raw files: GraphicsMagick does support ARW files, albeit
rendering is slow.  Via so called delegates it can be extended to
support additional file formats, and maybe I can tell it to use the
preview embedded in an ARW in order to speed things up.)

[1]: https://bugs.archlinux.org/task/77182


[-- Attachment #2: init.el --]
[-- Type: text/plain, Size: 839 bytes --]

(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(image-converter 'graphicsmagick)
 '(image-file-name-extensions
   '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg" "avif"))
 '(image-use-external-converter t)
 '(imagemagick-enabled-types t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-19  9:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-15 10:35 Displaying images Felix E. Klee
2023-01-15 11:40 ` Jean Louis
2023-01-15 12:09   ` Emanuel Berg
2023-01-15 19:27 ` Daniel Fleischer
2023-01-15 19:48   ` Felix E. Klee
2023-01-19  9:30 ` Felix E. Klee
  -- strict thread matches above, loose matches on Subject: below --
2003-01-31  2:40 displaying images Greg Hill

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.