Preserving normal map "extra areas" - gimp

This is what an image marked as a "normal image" looks like in Unity:
When I import this image into GIMP, this image appears like this:
I guess a big part of the image is stored in the alpha channel, and GIMP doesn't display it.
At first, I thought it was only a display problem, but when I then export it from GIMP and import it into Unity, the image looks like this:
(Yes, I have flipped it).
As one can see, the alpha channel is gone.
How could I tell GIMP to preserve it?
Thank you!
Edit: Here is some more information:
The image is a .TIFF.
If I save the edited image using "Overwrite ", then the background gets killed.
Then I try "Export as", and I choose "PNG". I leave "Save color values from transparent pixel" checked, and I leave the selection below at "Automatic pixel format". This also removes the "background".
What else could I try?

You don't say how you are exporting the image back from GIMP - but if you use the export as... dialog, upon choosing to export to .png, there is a save color values from transparent pixels checkbox.
Just check it before confirming the export.
(It won't show if you just click on export to NAME to write the same image back - you have to do export as... and select the same name for the dialog to apear).
Also, it is not that part of the image is stored in the alpha channel The alpha channel just contains opacity data - in this case, it contains a maks for regions of full-opacity/full-transparency for the shown region. GIMP's normal saving mechanism will erase the color data in the fully transparent areas to save image size upon exporting.
If you are using other image formats than PNG, GIMP does not have the option to preserve the data in transparent areas - the workarounds would be exporting to PNG and then converting to PNG with another tool (which might or not preserve these data), or raising the alpha-channel values to "1" instead of "0" before exporting in GIMP (can be done with colors->levels or colors->curves)

Related

OpenCV reads invisible image

I edited a simple png image with gimp, but it made transparent background black. So I tried undo'ing it, but nothing changed. Then I completely deleted all pixels (ctrl+A and delete) - this made image completely blank (white). But then I read it with OpenCV (python, ubuntu 16.04) and I still could see that old picture!
This is simple code I used to read image. As you can see it is completely blank (white).
But then I run the code and I can still see the old picture!
Here you can see - it is completely empty. I opened it with Firefox, Gimp, default ubuntu image viewer, windows photo viewer - same blank image.
So I decided to try something and I drawed with Gimp on that picture:
And I ran same code again:
After undo'ing question mark image returned to same. I figured - it could be some software error - I rebooted - same. Then I copied 'nothing.png' to Win10. Same code - same result. Image is about 449kB size. Here it is:
What the hell is going on here?
GIMP didn't erase the RGB data, it just sets the alpha channel to 0.
That's enough... unless you ignore the alpha channel.
OpenCV ignores the alpha channel... it's just another channel, not special at all. OpenCV can read and write RGBA data, and you can use the alpha channel like any other channel. It's just that display with imshow ignores the alpha channel and shows you the RGB data.

ImageMagick command to strip ICC color profiles

I have ~500 images that all seem to have a color profile on them; as when I upload to Shopify it changes the color tone of the images. This is due to Shopify stripping out the color profile on upload as per this link:
https://help.shopify.com/themes/customization/colors-images-and-video/fix-colors-of-uploaded-images
I have tried to use ImageMagick to strip out all the color profiles: mogrify +profile "-strip" *.jpg and this noticeably changes the image color which I can see on the image thumbnail but when I try uploading to Shopify the color is still being changed.
What am I doing wrong with ImageMagick? Or maybe it's not a color profile that needs removing?
I have also tried this on Photoshop using 'Save for Web', and this method strips out the color profile, but I don't want to do this for ~500 images, and File > Automate > Batch in CS6 doesn't have any Action for Save For Web. Can this be automated? I am running Windows.
Thanks
Original: http://imgur.com/3lcuZVy
Shopify: http://imgur.com/ko2bQvg
Photoshop: http://imgur.com/Ez3bNT4
EDIT:
I have run ImageMagick identity on the image 3 times. On the original image, on the image after upload to Shopify, and then 'save image as' and again after doing save for web on Photoshop
http://pastebin.com/710fHhJ0
Observations:
Original image: CMYK, ColorSeparation
Shopify image: sRGB, TrueColor
Photoshop image: sRGB, TrueColor
So after another ~hour of playing around I looked into Photoshop Automation. Turns out you can record your own macro and play it back. I wasn't aware you could record your own hence trying to play around with ImageMagick and this question.
For those who may stumble across this:
Window > Actions
[pops up on the toolbar]
Click the folded paper (New Action)
The record (circle) should now change to Red, it is recording.
Carry out your action, e.g mine was to go to File>Save for Web>click OK
Once finished your repetitive task, click the Stop button (square)
Now use your new recorded action, File > Automate > Batch
Unfortunately, this doesn't help those trying to do Save For Web using ImageMagick only.

Open *.data files as greyscale images in GIMP

I am trying to open a greyscale image in *.data format in GIMP, but the only options that I get are multichannel (RGB, RGB alpha, etc.). Is there a way to change this? Thanks.
File->Open
Choose Raw image data as the file type and find your .data file and open it.
In the proceeding Load Image From Raw Data dialog, set the Image Type to Indexed. Set the Offset to 0 and the Width and Height to the correct dimensions for your data. Leave everything under the Palette section as defaults.
Open in RGB and change Image > Mode > Greyscale?

How to Print Background Image Properly in Word 2003?

Issues:
- Background image not being printed in Word.
- Background image not printed at the right scale.
- Background image resolution is blurry.
This is a good solution if you are using Word 2003 and Illustrator/Photoshop. The finished document can be printed with other Word versions.
In illustrator/photoshop. Create a document at lettersize 8.5"x11".
Place your image/illustration and position it as you want.
Save for web and select png format.
Set width at 1650px (constrain proportion checked) and save.
Go to Word: Format/Background/Printed Watermark
Select picture water mark, browse and select the png file you just saved.
Set as 50% scale (this will make image sharper), and uncheck Washout. Apply and close.
You will now see your background image, and you can proceed with printing.

How to save a photoshop image after changing color channel visibility

I was messing around with the RGB channels in photoshop and found what I wanted when I removed visibility of the red channel, and kept blue and green. When I went to save my image it saved it in complete RGB. How do I temporarily remove the red channel from the image for saving? I have attached a pic for help. Thanks,
Before,
How I want it saved,
By definition if you are working with typical RGB images you have 3 channels of colors. You cannot erase one channel, keep the rest two channels and still have a valid image (in the strict RGB sense).
If you need to eliminate the information in one channel you just have to turn it to black. In your case, if you need to eliminate channel Red, then just select the Red channel and fill it completely with black color (ex. use the bucket fill with 255 tolerance). You will still end up with a 3-channel (or 4-channel if you have transparency) image but without any information from the Red channel.
i think you probably have the answer by this time but for the others.
after hide the unwanted channels click on image select all with CTRL+A then copy with CTRL+C and create a new layer paste it with CTRL+V and you're done!
I have a solution but it's not recommended:
Goto Adobe: View/Screen Mode/Full screen mode.
On the keyboard press Print Screen.
In Adobe open new file or press Ctrl+N and make settings as you want.
Tip: For high resolution, change Resolution to higher than 300 and press Ctrl+V and you are done.
Crop or Resize your picture and save it.
Tip: Press Shift while resizing to keep the picture in its original condition!

Resources