How to change png file parameter IHDR width using imageshack

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
sekhar916
Posts: 2
Joined: 2016-08-02T04:51:40-07:00
Authentication code: 1151

How to change png file parameter IHDR width using imageshack

Post by sekhar916 »

I have a image with X*Y size say 42*42 and I want to change the X part to 384 fixed. I have a sofware which accpets only 384*Y size of images.I can change manually the X to 384 using paint.

Open the image in paint.
press ctrl+e a windows will open with image properties
Change the Width to 384.
It adds some white space to that image. so that my original image doesnt gets altered.
My original image

http://i.stack.imgur.com/kXhet.png

altered picture

http://i.stack.imgur.com/zrH1Y.png

if you download the image then you can find the difference. My question is how can I do it using imagemagick command line.
roipoussiere
Posts: 9
Joined: 2016-08-02T03:02:48-07:00
Authentication code: 1151

Re: How to change png file parameter IHDR width using imageshack

Post by roipoussiere »

How to change png file parameter IHDR width using imageshack
I suppose you mean using imagemagick

You can use extent to change the image width without altering the image, and set the background to white:

Code: Select all

convert kXhet.png -background white -extent 384x42 output.png
result:

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

Re: How to change png file parameter IHDR width using imageshack

Post by fmw42 »

You can add -gravity XX to put the padding on the left, right or center (using XX = west, east or center)
sekhar916
Posts: 2
Joined: 2016-08-02T04:51:40-07:00
Authentication code: 1151

Re: How to change png file parameter IHDR width using imageshack

Post by sekhar916 »

roipoussiere wrote:
How to change png file parameter IHDR width using imageshack
I suppose you mean using imagemagick

You can use extent to change the image width without altering the image, and set the background to white:

Code: Select all

convert kXhet.png -background white -extent 384x42 output.png
result:

Image
thanks man the command worked like charm.....imagemagick community is very helpful
Post Reply