.png to .tif resulting in blank page

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
RAmbika
Posts: 15
Joined: 2018-03-27T06:45:41-07:00
Authentication code: 1152

.png to .tif resulting in blank page

Post by RAmbika »

Hi,

When we try to convert the .png file shared in the below link to tif it results in a blank page.

https://drive.google.com/file/d/1Jsp5cr ... sp=sharing

the command we are using is:
Convert.exe <InputFile> -monochrome <OutputFile>

Please have a look into it and let us know how can we resolve this.

Thanks,
Ambika

snibgo
Posts: 12897
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: .png to .tif resulting in blank page

Post by snibgo »

I don't know what result you want. Perhaps use "-threshold 50%" instead of "-monochrome".
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26261
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: .png to .tif resulting in blank page

Post by fmw42 »

What is your Imagemagick version and platform/OS? Your command works reasonably for me on IM 6.9.10.68 Q16 Mac OSX. The image is not totally black or blank.

Sebbaz
Posts: 1
Joined: 2019-10-25T08:15:27-07:00
Authentication code: 1152
Location: France

Re: .png to .tif resulting in blank page

Post by Sebbaz »

Hello,

I have the same issue with IM 7.0.8-2 Q16 x64 on Windows 7 Enterprise edition SP1
Tried also with IM 7.0.9-0 Q16 : https://framapic.org/gallery#rAO3rnS4tO ... OH2dLz.TIF

Maybe there is a link with issue 1627 ? https://github.com/ImageMagick/ImageMagick/issues/1627

User avatar
fmw42
Posts: 26261
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: .png to .tif resulting in blank page

Post by fmw42 »

-monochrome works for me with IM 7.0.8.68 Q16 Mac OSX. Except it loses the alpha channel. I have tried all the -define tiff:alpha options. I have tried -type options with alpha. I have tried turning off the alpha and then on again after -monochrome. Nothing keeps the alpha. Perhaps that is how it works with -monochrome.

Image

Code: Select all

magick hosted_with_lutim.png -monochrome hosted_with_lutim.tif
Image

RAmbika
Posts: 15
Joined: 2018-03-27T06:45:41-07:00
Authentication code: 1152

Re: .png to .tif resulting in blank page

Post by RAmbika »

Hi,

The tiff image which is produced with the below command is not in ccitt group 4 tiff file format

magick hosted_with_lutim.png -monochrome hosted_with_lutim.tif

Could you please provide us some alternative solution for this?

Thanks,
Ambika

snibgo
Posts: 12897
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: .png to .tif resulting in blank page

Post by snibgo »

snibgo's IM pages: im.snibgo.com

Ganesh_B
Posts: 20
Joined: 2018-03-06T05:29:40-07:00
Authentication code: 1152

Re: .png to .tif resulting in blank page

Post by Ganesh_B »

Hi Snibgo,

RAmbika & myself work in same team. Previously you mentioned <Perhaps use "-threshold 50%" instead of "-monochrome".>

So basing on that we are able to get good TIFF output using - 'Magick::Image::threshold()'.

Please let us know what is the issue with input image that adjusting Threshold is making good output. Is there any field of the input image from 'Magick::Image' object that can be read to differentiate with this input image from others. That is, we wanted to know what is the Field(input image) that has value that is not correct or resulting in this output.

Regards,
Ganesh.
(25057991)

User avatar
fmw42
Posts: 26261
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: .png to .tif resulting in blank page

Post by fmw42 »

-monochrome had a bug. Please upgrade to the latest version of ImageMagick and try again. Use -compress Group4 before saving the tiff as suggested by snibgo.

RAmbika
Posts: 15
Joined: 2018-03-27T06:45:41-07:00
Authentication code: 1152

Re: .png to .tif resulting in blank page

Post by RAmbika »

Hi,

When we integrate the binaries generated with latest version(7.0.9.16) in our code we are getting an exception.
Please check below screenshot.
https://drive.google.com/file/d/1DhOEpm ... sp=sharing

Could you please help us to resolve this issue?

Thanks,
Ambika

User avatar
fmw42
Posts: 26261
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: .png to .tif resulting in blank page

Post by fmw42 »

This command works fine for me on 7.0.9.16 Mac OSX Sierra

Code: Select all

magick IMG_20191001_150941.png -monochrome -compress group4 x.tif
What was your exact command line?

RAmbika
Posts: 15
Joined: 2018-03-27T06:45:41-07:00
Authentication code: 1152

Re: .png to .tif resulting in blank page

Post by RAmbika »

Hi,
ImageMagick API is throwing an "Access violation" exception. Please find the console application at the below path to replicate the issue. We are using 32 bit imagemagick binaries generated from ImageMagick-7.0.9-19 version.
https://drive.google.com/file/d/1hP0TEN ... sp=sharing

Our Environment:
Window 7 OS
Visual Studio 2017

Please have a look into it and let us know how can we resolve this?

Post Reply