ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] .jpx and .jxl
@ 2024-03-04 14:30 Jim
  2024-03-05 14:18 ` [NTG-context] " Taco Hoekwater
  2024-03-05 20:29 ` Wolfgang Schuster
  0 siblings, 2 replies; 4+ messages in thread
From: Jim @ 2024-03-04 14:30 UTC (permalink / raw)
  To: ntg-context

Recently I've been trying to make some PDFs smaller by using better
compression of JPEG pictures.

I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
files.  However, my understanding (and I could well be wrong, but I've seen
it multiple places) is that JPEG 2000 *Part 2* files should have extension
.jpx, not .jp2.

By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
to have a .jp2 extension, then ConTeXt properly processes the file and I
see the picture in the PDF.

Q: are there any plans to make ConTeXt recognize the .jpx extension?
   If not, can anyone suggest some ConTeXt code which allows me to tell
   ConTeXt to process a .jpx file as a .jp2 file?


I have also been investigating the use to JPEG-XL files (.jxl).  One of the
interesting aspects of JXL files is that .jpg files can be **losslessly**
compressed into .jxl files.  (That is, you can recover the exact .jpg from
the .jxl file if you want, so there is no further degradation of the image
by doing this lossless compression.)  I have been seeing 20% to 30%
reduction in file sizes by converting JPGs into JXLs, which I would be
happy to make use of in my PDFs, if possible.

Bonus question: is there any plan to support JXL files in ConTeXt?

Thanks.
                                Jim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: .jpx and .jxl
  2024-03-04 14:30 [NTG-context] .jpx and .jxl Jim
@ 2024-03-05 14:18 ` Taco Hoekwater
  2024-03-05 19:14   ` Jim
  2024-03-05 20:29 ` Wolfgang Schuster
  1 sibling, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 2024-03-05 14:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 4 Mar 2024, at 15:30, Jim <zlists+context@jdvb.ca> wrote:
> 
> Recently I've been trying to make some PDFs smaller by using better
> compression of JPEG pictures.
> 
> I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
> files.  However, my understanding (and I could well be wrong, but I've seen
> it multiple places) is that JPEG 2000 *Part 2* files should have extension
> .jpx, not .jp2.
> 
> By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
> to have a .jp2 extension, then ConTeXt properly processes the file and I
> see the picture in the PDF.
> 
> Q: are there any plans to make ConTeXt recognize the .jpx extension?
>   If not, can anyone suggest some ConTeXt code which allows me to tell
>   ConTeXt to process a .jpx file as a .jp2 file?


The recognised extensions are specified in a table in grph-inc.lmt, I don’t 
think you can alter that table runtime. 

But it is possible to do

  \externalfigure[method=jp2,file=….jpx]

Untested, but should work.

Best wishes,
Taco

> 
> 
> I have also been investigating the use to JPEG-XL files (.jxl).  One of the
> interesting aspects of JXL files is that .jpg files can be **losslessly**
> compressed into .jxl files.  (That is, you can recover the exact .jpg from
> the .jxl file if you want, so there is no further degradation of the image
> by doing this lossless compression.)  I have been seeing 20% to 30%
> reduction in file sizes by converting JPGs into JXLs, which I would be
> happy to make use of in my PDFs, if possible.
> 
> Bonus question: is there any plan to support JXL files in ConTeXt?
> 
> Thanks.
>                                Jim
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________

— 
Taco Hoekwater              E: taco@bittext.nl
genderfluid (all pronouns)


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: .jpx and .jxl
  2024-03-05 14:18 ` [NTG-context] " Taco Hoekwater
@ 2024-03-05 19:14   ` Jim
  0 siblings, 0 replies; 4+ messages in thread
From: Jim @ 2024-03-05 19:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Tue, Mar  5, 2024 at 15:18 (+0100), Taco Hoekwater wrote:


>> On 4 Mar 2024, at 15:30, Jim <zlists+context@jdvb.ca> wrote:

>> Recently I've been trying to make some PDFs smaller by using better
>> compression of JPEG pictures.

>> I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
>> files.  However, my understanding (and I could well be wrong, but I've seen
>> it multiple places) is that JPEG 2000 *Part 2* files should have extension
>> .jpx, not .jp2.

>> By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
>> to have a .jp2 extension, then ConTeXt properly processes the file and I
>> see the picture in the PDF.

>> Q: are there any plans to make ConTeXt recognize the .jpx extension?
>> If not, can anyone suggest some ConTeXt code which allows me to tell
>> ConTeXt to process a .jpx file as a .jp2 file?


> The recognised extensions are specified in a table in grph-inc.lmt, I don’t 
> think you can alter that table runtime. 

> But it is possible to do

>   \externalfigure[method=jp2,file=….jpx]

> Untested, but should work.

Taco,

I could not get that to work, but I did get
        \externalfigure[somefile.jpx][method=jp2]
to work.  Thanks very much for leading me to that solution.

                        Jim

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: .jpx and .jxl
  2024-03-04 14:30 [NTG-context] .jpx and .jxl Jim
  2024-03-05 14:18 ` [NTG-context] " Taco Hoekwater
@ 2024-03-05 20:29 ` Wolfgang Schuster
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2024-03-05 20:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jim



Jim schrieb am 04.03.2024 um 15:30:
> Recently I've been trying to make some PDFs smaller by using better
> compression of JPEG pictures.
> 
> I was happy to see that \externalfigure cheerfully accepts .jp2 (JPEG 2000)
> files.  However, my understanding (and I could well be wrong, but I've seen
> it multiple places) is that JPEG 2000 *Part 2* files should have extension
> .jpx, not .jp2.
> 
> By default, ConTeXt does not recognize .jpx.  But if I rename a .jpx file
> to have a .jp2 extension, then ConTeXt properly processes the file and I
> see the picture in the PDF.
> 
> Q: are there any plans to make ConTeXt recognize the .jpx extension?
>     If not, can anyone suggest some ConTeXt code which allows me to tell
>     ConTeXt to process a .jpx file as a .jp2 file?


Adding

     \definegraphictypesynonym [jpx] [jp2]

at the begin of your document should do the trick.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-03-05 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-04 14:30 [NTG-context] .jpx and .jxl Jim
2024-03-05 14:18 ` [NTG-context] " Taco Hoekwater
2024-03-05 19:14   ` Jim
2024-03-05 20:29 ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).