• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JuliuszK · Jun 10, 2017 at 07:29 AM · textureruntimeimporterimage loader

How do I import TGA, DDS, GIF, PCX and BMP files at runtime?

Hi, Is there a solution to load at runtime, from any location on disk the following file formats: TGA, DDS, PCX, GIF, BMP ? It also should work both - in Editor and Runtime.

I am aware of WWW class, which lets me load JPG and PNG formats, which is fine (I will need to load PNG files too), but not enough.

I'm also aware of Resource.Load() function, but these files need to be loaded from outside of Unity project folder.

I have also come across this asset on AS, but it's been retired from the Asset Store. And the author had not replied to me. https://forum.unity3d.com/threads/advanced-importer.248725/

If such a solution does not exist - how do I go about writing my own image loaders?

Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by dpoly · Sep 14, 2017 at 04:05 AM

There is an answer here for BMP: http://answers.unity3d.com/questions/1308973/how-to-load-a-bmp-file-in-binary.html (without trailing dot).

Basically you have to roll your own, or get code from someone else who did. From the bits up.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JuliuszK · Sep 14, 2017 at 08:57 PM 0
Share

Thanks - that's what I was afraid to hear... The link does not work though.

avatar image dpoly JuliuszK · Sep 15, 2017 at 12:05 AM 0
Share

Surely you noticed the link got a trailing dot? Try it now. [bug in web site editor] Note you can also use System.Drawing.

avatar image JuliuszK dpoly · Sep 15, 2017 at 06:52 PM 0
Share

Sorry, I didn't look at the link itself - just clicked on it! Thanks for fixing it.

avatar image Bunny83 · Sep 15, 2017 at 12:31 AM 0
Share

I actually wrote a gif importer as well, but it's not polished for release. It's also ment to load and decode / decompress the gif data structure on a low level. Since the GIF format has quite a few features it doesn't have to be just a single image. GIF is a crazy format and it's a pity that its potential isn't used by most gif readers / writers. A gif file could be used as a generic meta data file. It consists of logical blocks and support custom application extensions.

Lately i'm not very keen on working on it. There are already some GIF solutions on the assetstore as far as i remember. Though if enough people are interested in a GIF solution i may continue ^^.

avatar image JuliuszK Bunny83 · Sep 15, 2017 at 06:54 PM 0
Share

Hey, if you ever finish it, let me know. I don't feel crazily enthusiastic about re-inventing the wheel, so would be happy to purchase an asset that can do these kind of low-level yet essential things.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

85 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Runtime Normal Map Import Issues 0 Answers

How to update texture during runtime to display damage? 0 Answers

Load texture and shaders at runtime on iPhone 2 Answers

export normal texture at runtime 2 Answers

How to import .obj at runtime using Javascript? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges