Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored image become grayscale randomly on resize #7152

Closed
L3o-pold opened this issue Mar 8, 2024 · 7 comments
Closed

Colored image become grayscale randomly on resize #7152

L3o-pold opened this issue Mar 8, 2024 · 7 comments

Comments

@L3o-pold
Copy link

L3o-pold commented Mar 8, 2024

ImageMagick version

7.1.1-29

Operating system

Linux 5.10.0-0.deb10.16-amd64 #1 SMP Debian 5.10.127-2~bpo10+1 (2022-07-28) x86_64 GNU/Linux

Description

Randomly when resizing a file the result became grayscale (black and white only).

Steps to Reproduce

#!/bin/bash
for i in {1..1000}
do
  magick convert test.jpg -resize '1920x>' -verbose ./tmp/test.jpg`
done

When the resized image is correct it will output:

test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 93218B 0.040u 0:00.037

test-12

When the resized image is not correct it will output:

test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 81473B 0.040u 0:00.073

test-12

Images

CleanShot

@fmw42
Copy link

fmw42 commented Mar 8, 2024

It works fine for me on IM 7.1.1.29 Mac Ventura doing

cd
cd desktop/test
for ((i=0; i<20; i++)); do
magick image.jpg -resize '1920x>' image_$i.jpg
done

Either try removing the -verbose or move it just after magick.

@fmw42 fmw42 closed this as completed Mar 8, 2024
@fmw42 fmw42 reopened this Mar 8, 2024
@L3o-pold
Copy link
Author

L3o-pold commented Mar 8, 2024

I do not reproduce on mac either.

@fmw42
Copy link

fmw42 commented Mar 8, 2024

Possibly a bad install on Linux. What are your versions for your JPG delegate? Are they the same on Linux as Mac?

@L3o-pold
Copy link
Author

L3o-pold commented Mar 9, 2024

How to display the version?

magick -list delegate

Path: /usr/local/etc/ImageMagick-7/delegates.xml

Delegate                Command
-------------------------------------------------------------------------------
    blender =>          "blender' -b '%i' -F PNG -o '%o''\n'magick' convert -concatenate '%o*.png' '%o"
        bpg =>          "bpgdec' -b 16 -o '%o.png' '%i'; /usr/bin/mv '%o.png' '%o"
 dng:decode =>          "ufraw-batch' --silent --create-id=also --out-type=png --out-depth=16 '--output=%u.png' '%i"
        doc =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       docx =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        dot =>          "dot' -Tsvg '%i' -o '%o"
        dvi =>          "dvips' -sstdout=%%stderr -o '%o' '%i"
        eps<=>pdf       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 '-sDEVICE=pdfwrite' '-sOutputFile=%o' '-f%i"
        eps<=>ps        "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=ps2write' '-sOutputFile=%o' '-f%i"
       epub =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        hpg =>          "hp2xx' -sstdout=%%stderr -m eps -f `basename '%o'` '%i';     /usr/bin/mv -f `basename '%o'` '%o"
       hpgl =>          "hp2xx' -sstdout=%%stderr -m eps -f `basename '%o'` '%i';     /usr/bin/mv -f `basename '%o'` '%o"
        htm =>          "html2ps' -U -o '%o' '%i"
       html =>          "html2ps' -U -o '%o' '%i"
https:decode =>          "curl' -s -L -o '%u.dat' 'https:%M"
       ilbm =>          "ilbmtoppm' '%i' > '%o"
        jpg<= lep       "lepton' '%i' '%o"
        jxr =>          "/usr/bin/mv '%i' '%i.jxr'; 'JxrDecApp' -i '%i.jxr' -o '%o.tiff'; /usr/bin/mv '%i.jxr' '%i'; /usr/bin/mv '%o.tiff' '%o"
        lep =>          "lepton' '%i' '%o"
       miff<= show      "magick' display -immutable -delay 0 -title '%M' '%i"
        odg =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        odt =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        pdf<=>eps       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=eps2write' '-sPDFPassword=%a' '-sOutputFile=%o' '-f%i"
        pdf<=>ps        "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=ps2write' '-sPDFPassword=%a' '-sOutputFile=%o' '-f%i"
        png<= bpg       "bpgenc' -b 12 -q '%~' -o '%o' '%i"
        png<= webp      "cwebp' -quiet -q %Q '%i' -o '%o"
        pnm<= trace     "potrace' --svg --output '%o' '%i"
        pnm<= ilbm      "ppmtoilbm' -24if '%i' > '%o"
        ppt =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       pptx =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
         ps<= prt       "lpr' '%i"
         ps<=>eps       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=eps2write' '-sOutputFile=%o' '-f%i"
         ps<=>pdf       "gs' -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pdfwrite' '-sOutputFile=%o' '-f%i"
         ps<= print     "@LPRDelegateDefault@ '%i"
      shtml =>          "html2ps' -U -o '%o' '%i"
        sid =>          "mrsidgeodecode' -if sid -i '%i' -of tif -o '%o' > '%u"
        svg =>          "rsvg-convert' -o '%o' '%i"
       tiff<= jxr       "/usr/bin/mv '%i' '%i.tiff'; 'JxrEncApp' -i '%i.tiff' -o '%o.jxr'; /usr/bin/mv '%i.tiff' '%i'; /usr/bin/mv '%o.jxr' '%o"
       tiff<= wdp       "/usr/bin/mv '%i' '%i.tiff'; 'JxrEncApp' -i '%i.tiff' -o '%o.jxr'; /usr/bin/mv '%i.tiff' '%i'; /usr/bin/mv '%o.jxr' '%o"
       tiff<= text      "tesseract' '%i' '%u'; /usr/bin/mv '%u.txt' '%o"
       tiff<= launch    "gimp' '%i"
video:decode =>          "ffmpeg' -nostdin -loglevel error -i '%s' -an -f rawvideo -y %s '%s"
        vsd =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       vsdx =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
        wdp =>          "/usr/bin/mv '%i' '%i.jxr'; 'JxrDecApp' -i '%i.jxr' -o '%o.tiff'; /usr/bin/mv '%i.jxr' '%i'; /usr/bin/mv '%o.tiff' '%o"
       webp =>          "dwebp' -pam '%i' -o '%o"
        xls =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"
       xlsx =>          "libreoffice' --convert-to pdf -outdir `dirname '%i'` '%i' 2> '%u'; /usr/bin/mv '%i.pdf' '%o"

@urban-warrior
Copy link
Member

Thank you for reporting the issue. We have successfully reproduced it and are actively working on a patch to resolve it. You can expect this patch to be merged into the main GIT branch, later today. As part of our commitment to quality, this fix will also be included in the upcoming beta releases of ImageMagick by tomorrow. Your patience and feedback are greatly appreciated.

@Dangerar
Copy link

Hi @L3o-pold,

did a newer version solved this for you. I have still the problem on Win with 7.1.1-36.

Best regards
Daniel

@L3o-pold
Copy link
Author

Yes it's solved for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants