LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-12-2017, 03:01 PM   #1
wagscat123
Member
 
Registered: Jan 2009
Location: Maryland-Pennsylvania border, USA
Distribution: openSUSE 15.2, Tumbleweed, Kubuntu 18.04/20.10, macOS 10.15, antiX 19, and Linux Mint 19.3
Posts: 857
Blog Entries: 45

Rep: Reputation: 119Reputation: 119
Gdal creates invalid RAW files


Hi all,

I'm using the following Gdal command to get png and tiff files into the Photoshop RAW format:

Code:
gdal_translate -ot UInt16 -of png -outsize 193 193 -scale 3d_test_at2-trimmed.png 3d_test_at2_gd.raw
Except with GTiff thrown in with the tiff file.

When I run these, the output RAW files do not open in a program I'm importing them into, nor into Photoshop or UFRAW. Both report that the file is invalid, or in the wrong format.

Any tips/ideas on why this is so? This seems to be a bit oscure for Google to answer.

Last edited by wagscat123; 01-12-2017 at 03:08 PM.
 
Old 01-12-2017, 06:26 PM   #2
Brains
Senior Member
 
Registered: Apr 2009
Distribution: Debian Testing, Gentoo
Posts: 1,293

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
I believe the Photoshop raw file format is .dng, all other raw formats are typically camera manufacturer specific.
 
1 members found this post helpful.
Old 01-12-2017, 06:47 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,523

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
gdal will

you told the program this " -ot UInt16 -of png "
so it will be a 16 ushort unsgined grayscal png

that will not be a "raw" image

technically gdal dose not output a raw image but a few formats are very close

i normally use EHdr
Code:
gdal_translate -of EHdr 16ppd.geo_bathy.cub 16ppd.geo_bathy.raw
------
Input file size is 5760, 2880
0...10...20...30...40...50...60...70...80...90...100 - done.
file list
Code:
├── 16ppd.geo_bathy.cub
├── 16ppd.geo_bathy.hdr
├── 16ppd.geo_bathy.prj
├── 16ppd.geo_bathy.raw
└── 16ppd.geo_bathy.raw.aux.xml
read the *.hdr text file for the image information
in this case the ISIS3 cub is a 16 bit signed DEM
Code:
BYTEORDER      I
LAYOUT         BIL
NROWS          2880
NCOLS          5760
NBANDS         1
NBITS          16
BANDROWBYTES   11520
TOTALROWBYTES  11520
PIXELTYPE      SIGNEDINT
ULXMAP         -20033913.3899541
ULYMAP         10015217.3380241
XDIM           6957.4278138406
YDIM           6957.4278138406
NODATA         -32768
and opining the raw using G'Mic
Code:
gmic 16ppd.geo_bathy.raw,short,5760,2880
http://imgbox.com/vhIAObwW

.

Last edited by John VV; 01-12-2017 at 06:54 PM.
 
Old 01-13-2017, 10:28 AM   #4
wagscat123
Member
 
Registered: Jan 2009
Location: Maryland-Pennsylvania border, USA
Distribution: openSUSE 15.2, Tumbleweed, Kubuntu 18.04/20.10, macOS 10.15, antiX 19, and Linux Mint 19.3
Posts: 857

Original Poster
Blog Entries: 45

Rep: Reputation: 119Reputation: 119
I ended up ruling out the method of converting my heightmaps to Unity3D's preferred RAW format, and don't need to fight it out with Gdal anymore. Many thanks for the tips though, if I need to to this again at some point later I can refer back to this thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where tomcat6 application creates its files? nuoritoveri Linux - Server 0 09-27-2012 03:57 AM
gcc only creates .o files, does not link jmite Linux - Newbie 1 10-19-2008 10:31 PM
linux creates duplicate files bnebradd Linux - Newbie 17 07-08-2007 05:11 PM
which module creates device files baloon Red Hat 8 03-29-2007 03:00 PM
LXer: Piracy creates jobs, FOSS creates opportunities LXer Syndicated Linux News 0 11-02-2006 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration