matching output from the identifty command.

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
nitrolinux722
Posts: 5
Joined: 2015-11-22T18:08:08-07:00
Authentication code: 1151

matching output from the identifty command.

Post by nitrolinux722 »

Hello,

I am using ImageMagick 6.9.2-6 Q16 x64 on WIndows 10. I recently use the "identify" command with the "verbose" switch to read some detailed information about an DDS image type. I'm trying to conform the information I received to be able to change another DDS image to the same attributes. The only difference I see between the two are the channel depth, RGB colors and Aplha channel. Below is the two differences:

unedited image:

Code: Select all

Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 8-bit
  Channel statistics:
    Pixels: 3130592
    Red:
      min: 0 (0)
      max: 254 (0.996078)
      mean: 96.6081 (0.378855)
      standard deviation: 54.2584 (0.212778)
      kurtosis: 0.35092
      skewness: -0.383135
      entropy: 0.70386
    Green:
      min: 0 (0)
      max: 254 (0.996078)
      mean: 81.2331 (0.318561)
      standard deviation: 61.269 (0.240271)
      kurtosis: -0.592613
      skewness: 0.302419
      entropy: 0.80537
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 136.069 (0.533605)
      standard deviation: 74.9801 (0.29404)
      kurtosis: -0.0849212
      skewness: -0.363942
      entropy: 0.73598
    Alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 181.715 (0.71261)
      standard deviation: 115.291 (0.452123)
      kurtosis: -1.11436
      skewness: 0.940305
      entropy: 0.114513
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 96.7988 (0.379603)
      standard deviation: 80.0187 (0.313799)
      kurtosis: -0.386124
      skewness: 0.433003
      entropy: 0.589931
Image I need to change to match unedited image:

Code: Select all

Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit
  Channel statistics:
    Pixels: 3130592
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 106.208 (0.416501)
      standard deviation: 75.1977 (0.294893)
      kurtosis: -0.985669
      skewness: 0.152831
      entropy: 0.898439
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 99.9096 (0.391803)
      standard deviation: 74.6307 (0.29267)
      kurtosis: -0.983288
      skewness: 0.283349
      entropy: 0.900504
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 116.019 (0.454975)
      standard deviation: 90.586 (0.355239)
      kurtosis: -1.28064
      skewness: 0.281044
      entropy: 0.807191
    Alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 211.305 (0.828648)
      standard deviation: 96.0881 (0.376816)
      kurtosis: 1.04274
      skewness: 1.74434
      entropy: 0.0825984
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 91.4577 (0.358658)
      standard deviation: 84.651 (0.331965)
      kurtosis: -0.606921
      skewness: 0.627267
      entropy: 0.672183
I've tried to make sense of the command-line tool "convert", but I am at a lost to how I would formulate a command to change the edited image to match the unedited image or even if it's possible. Any help would be appreciated.

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

Re: matching output from the identifty command.

Post by fmw42 »

It is not likely you can match the two, since you are trying to change a 1-bit alpha channel to 8-bits. To do that you would need to blur or feather the alpha channel to anti-alias it to 8-bits.

If the two images are exactly the same data and size except for the alpha channel, then you can transfer the alpha channel from the one image to the other image.

Please post your images to some free hosting service such as dropbox.com and put the URL here so we can take look and see what might be done.
nitrolinux722
Posts: 5
Joined: 2015-11-22T18:08:08-07:00
Authentication code: 1151

Re: matching output from the identifty command.

Post by nitrolinux722 »

Hello fmw42,

Thank you for the post. What I'm trying to do is modify a DDS file that is a part of a virtual screen background that we use to key out a green screen. I was able to get the image to finally to come up, but it had a purple tint. The image I'm using is one I created in Valve's Hammer. It's a way for me to create a 3D set without having to spend a thousand dollars on software that allows us to create these virtual sets. In my thinking, i could replace an image and try to match it close to the original attributes of the original image and maybe get some success. I'm kinda there and I wish i had an image of the success, but I don't at this moment. In this post I have included the files that are on my dropbox. Please take a look at them and tell me what you think.

https://www.dropbox.com/s/qksa069bvdod2 ... d.dds?dl=0 (unedited)

https://www.dropbox.com/s/sdvzuahqaqe9v ... d.dds?dl=0 (edited)

Thank you.

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

Re: matching output from the identifty command.

Post by fmw42 »

Can you clarify what you are trying to do? Are you trying to take the bible sign from the one image and put it into the transparent area of the other image? Or are you trying to make the region of the bible sign transparent? Sorry I am confused about your goal.
nitrolinux722
Posts: 5
Joined: 2015-11-22T18:08:08-07:00
Authentication code: 1151

Re: matching output from the identifty command.

Post by nitrolinux722 »

We have a product made by NewTek called tricaster 40. It uses what is called virtualsets. These images are like tv studios, but only virtual. The tricaster 40 uses these images, like the one DDS file that is unedited. Strangely enough, it does not appear that way once loaded into the tricaster. It's colors are correct. Not the purple tints like you see. Why I don't know. Maybe you can enlighten me on more about DDS file types. I know it belongs to Mircosoft. Direct Draw?? Now, the virtual set we are using now for our Bible Talk program is the studio107. We are trying to do something different for 2016. I was hoping to be able to conform my edited image like the original one, maybe giving it a chance to work. Then again, maybe it will be totally impossible to do this. On a side note, there are other files that come into play that makes this work. Below is an example of the directory structure:

/Studio107
| uv.dds
| ycbcra.dds
Studio107.LiveSet (an XML file)
Studio107.png

The Studio107.LiveSet file calls the DDS files to be loaded in the XML file. I'm sure I've confuse you greatly now, but if you have any ideal about this, please let me know.

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

Re: matching output from the identifty command.

Post by fmw42 »

I still do not understand what you are trying to do with the two images. Can you provide a command line using the two files you provided? And explain the goal your are trying to achieve in terms of what you expect to see where in the edited image? The two images do not seem to conform to each other.

Does the unedited image display correctly in IM?
nitrolinux722
Posts: 5
Joined: 2015-11-22T18:08:08-07:00
Authentication code: 1151

Re: matching output from the identifty command.

Post by nitrolinux722 »

I guess in simple terms I want to make the edited image like the unedited image when it comes to the red, blue, and green channels. I have not attempted to do any changes with the convert tool. I've pretty much resolved to the fact that number one, I really don't know how to ask what I'm trying to ask. And number two, I've wasted enough of your time. I'm just going to have to break down and purchase this . What is the best way to mark this thread? [GIVING UP]
LOL . Thank you for your help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: matching output from the identifty command.

Post by fmw42 »

This seems to be about as good as I can do, though not very good.

I cropped your image and saved as png. Then did the following.

Code: Select all

convert ycbcra_unedited.png -set colorspace YCbCr -colorspace sRGB ycbcra_unedited_ycbcr2srgb.png
Image

histmatch script or -recolor to the edited image just seems to make it worse.
nitrolinux722
Posts: 5
Joined: 2015-11-22T18:08:08-07:00
Authentication code: 1151

Re: matching output from the identifty command.

Post by nitrolinux722 »

Thank you for your example. Is it possible to take the "color information", for the lack of the correct term, of one image and transfer that information to another image. Such as in these files. unedited image's RGB info to the edited image. To further explain, like in the very top post, I give the main differences of the two images. Like the Red channel of the unedited image is:

Red:
min: 0 (0)
max: 254 (0.996078)
mean: 96.6081 (0.378855)
standard deviation: 54.2584 (0.212778)
kurtosis: 0.35092
skewness: -0.383135
entropy: 0.70386

Make the edited image Red Channel match these same numbers. Is that possible?

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

Re: matching output from the identifty command.

Post by fmw42 »

I tried that with my script histmatch, at the link below,http://www.imagemagick.org/Usage/quantize/#remap (which matches histograms) and with the IM function -remap (see http://www.imagemagick.org/Usage/quantize/#remap). Neither worked well. User snibgo also has a histogram matching technique at http://im.snibgo.com/. Perhaps his approach will work better than mine.

But these work best when you have the same image content. So, if you can provide an example image before and after editing, rather than two different images, then perhaps we can validate some mechanism that reproduces that editing result.
Post Reply