• Re: Sixel Gallery - Viewa

    From paulie420@BEERS20 to Codefenix on Wed Feb 8 20:48:00 2023
    I tweaked my Sixel Gallery script a bit, adding an optional image path argument. If used, simply displays the specified image converted to
    sixel and ends. Using this small mod, I set up GIF, JPG, PNG, and BMP as Viewable File Types in SCFG. So now whenever someone browses directories containing images (e.g.: GIFs Galore CD-ROM), if they go into Extended Info for any image file and hit V to view it, they are shown a sixel preview of the image.

    VERY nice, Code - I also had this 'idea' for .PDFs... one could quickly use a sixel converter to turn a PDF into a .six and display to the user. I'll come by and see yer new gallery; nice work.



    |07p|15AULIE|1142|07o
    |08.........
  • From Codefenix@CONCHAOS to paulie420 on Thu Feb 9 09:12:32 2023
    Re: Re: Sixel Gallery - Viewa
    By: paulie420 to Codefenix on Wed Feb 08 2023 08:48 pm

    Hey Paulie :)

    VERY nice, Code - I also had this 'idea' for .PDFs... one could quickly use a sixel converter to turn a PDF into a .six and display to the user.

    PDF to image conversion is a bit of a rabbit hole, considering it's a multi-page document format and can contain mixed media (text and/or images).

    At work I use GhostScript to take PDF documents and convert each page to a separate TIF image, which gets stored in our document management software. That part's easy enough, as GS has command line options for that use case.

    So, in theory, you could use GS to convert your source PDF to as many images as it has pages, and then convert those resulting images to sixel with ImageMagick, and display them. These conversion steps could take some time to complete if you plan on doing them on-the-fly.

    Here's where it gets hairy...

    In my case I need to make my TIF output black and white, because GS' color output options usually end up generating ENORMOUS image files. It can output to PNG and JPG as well, but there's still the issue of file size. If you're only storing the image files temporarily, maybe it's not a problem, but still something to think about.

    The other consideration is text quality/legibility. By converting PDF text to an image, the text won't look as sharp. By further converting it to sixel, it could look worse, especially if ImageMagick is scaling down the sixel for viewing in a typical 80x24 SyncTERM window. Maybe this isn't an issue if your source PDF is primarily image-based. But if it's text-based (but not a scanned image of text), you might consider using a tool like Poppler's pdftotext to extract the text from the PDF and display that as an alternative.

    |01<|09co|03d|11e|15ƒ|11e|03n|09ix|01>|07
    ---
    ■ Synchronet ■ -=[ ConstructiveChaos BBS | conchaos.synchro.net ]=-
  • From paulie420@BEERS20 to Codefenix on Thu Feb 9 18:59:00 2023
    [All great info in your reply. Appreciate all the points you posted; thanks!!]

    The other consideration is text quality/legibility. By converting PDF
    text to an image, the text won't look as sharp. By further converting it to sixel, it could look worse, especially if ImageMagick is scaling down the sixel for viewing in a typical 80x24 SyncTERM window. Maybe this
    isn't an issue if your source PDF is primarily image-based. But if it's text-based (but not a scanned image of text), you might consider using a tool like Poppler's pdftotext to extract the text from the PDF and
    display that as an alternative.

    I get a similar issue w/ the PDF not being quality enough to make a [good enough] conversion to text - so your point probably applies even more; if I can't get good TEXT out of it the SIXEL conversion would probably suffer as well.



    |07p|15AULIE|1142|07o
    |08.........