On Wednesday, 5 August 2020 16:08:13 GMT Ralph Corderoy wrote: > Whilst all this clicking means you're learning Gimp, and it could > instead be coded in Python using the Python Imaging Library we keep > referring to, there's also Netpbm from the shell. > > wget -q -O lenna.png \ > https://upload.wikimedia.org/wikipedia/en/7/7d/ Lenna_%28test_image%29.png > > w=128 h=128 # Desired size. > pngtopnm lenna.png | > pamscale -xyfit $w $h | > pnmpad -w $w -h $h | > pnmremap -mapfile=<(pamseq 1 15) | > pnmtopng >lenna-grey.png
Ralph, I've been having a few problems reproducing my early success using The Gimp to convert my images (I did document it, but I must have left something out). Anyway, I thought I would give your bash code a try. I found and fixed an error; pamscale doesn't exist, but pnmscale does but I still can't make it work. When execution reaches the penultimate line I get the error: ./scale: line 5: pamseq: command not found followed by a couple of EOF errors that I assume are caused by the pnmremap failure. I've had a good rummage and can't find a package that provides pamseq. Can you tell me how to fix this? Also. I assume that 'pamseq 1 15' is telling pnmremap to change the image colormap to 16 levels. I would have expected the numbers to be 0 & 15 or 1 & 16. Any reason why 1 & 15 are used? -- Terry Coles -- Next meeting: Online, Jitsi, Tuesday, 2020-12-01 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk