Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Code for texconv

Featured Replies

  • Author
  • Localization

noire90, posted Sun Feb 14, 2021 1:12 pm (62202)


A batch code line for texconv to remove the alpha channel inside my .dds files, Luigi please. I need to remove the transparency from them. A code line that remove the transparency please, for texconv or for another... you have the skills to help me... I have spend days to read on line and try to find the solution but I failed.
  • Author
  • Localization

Shokoniraya, posted Sun Feb 14, 2021 6:54 pm (62209)


if you want to do some changes in a image channel, you should convert it to a raw-32bit and then start to messing with RGBA blocks (or 64bit, 16-bit? 8-bit? i hope 64-bit color dream never came true for black future!)

if you want to deal with a picture, you have to use a photo editor, paint.NET is a free one

you can convert your image with texconv.exe
Code:
"texconv.qgp" -y -ft TGA -m 1 "my_image.png" -o "output_folder"


normal transparency (full, i mean no alpha) is 0xFF (255)
and alpha colors are between 00 (full alpha) and 0xFF (full color)

use below script on 32-bit tga files to make transparency colors to full colors
Code:
get FILE_NAMER filename
string FILE_NAME = ""
string FILE_NAME "transparency_fixer"
string FILE_NAME \
string FILE_NAME FILE_NAMER
get SIZER asize
xmath PIXEL_COUNT "(SIZER - 18) / 4"
log MEMORY_FILE1 0 SIZER
goto 18 MEMORY_FILE1
for i = 0 < PIXEL_COUNT
get RGB_COLOR threebyte MEMORY_FILE1
get ALPHA_CODE byte MEMORY_FILE1
if ALPHA_CODE > 0x00 & ALPHA_CODE < 0xFF
savepos CURRENT_LOCATION MEMORY_FILE1
math CURRENT_LOCATION - 1
goto CURRENT_LOCATION MEMORY_FILE1
put 0xFF byte MEMORY_FILE1
endif
next i

log FILE_NAME 0 SIZER MEMORY_FILE1
  • Author
  • Localization

noire90, posted Sun Feb 14, 2021 7:24 pm (62212)


Thanks for your answer but those codes don't worked in my case. I know that I can modify them with gimp one by one (adding inside them a white layer) but it's a lot of work... :( My .dds are 5GXT maybe this is the reson that those codes don't worked... I don't know.
  • Author
  • Localization

Shokoniraya, posted Sun Feb 14, 2021 7:32 pm (62213)


noire90 wrote:
Thanks for your answer but those codes don't worked in my case. I know that I can modify them with gimp one by one (adding inside them a white layer) but it's a lot of work... :( My .dds are 5GXT maybe this is the reson that those codes don't worked... I don't know.


my script just works on 32-bit TGA files
convert your file with this batch code (with texconv.exe)
Code:
md "output_folder"
"texconv.qgp" -y -ft TGA -m 1 "my_image.png" -o "output_folder"
  • Author
  • Localization

noire90, posted Sun Feb 14, 2021 7:42 pm (62214)


I need a code for dds file please because my importer recognize just the dds textures
  • Author
  • Localization

Shokoniraya, posted Mon Feb 15, 2021 11:33 am (62230)


noire90 wrote:
I need a code for dds file please because my importer recognize just the dds textures

convert your texture to tga and do your job and convert it to dds when you finish it

let me tell you something, if you want to edit texture files, you have to learn about color codes, texture encodings, mipmaps, block types, bit depth and many other things...
  • Author
  • Localization

noire90, posted Mon Feb 15, 2021 12:07 pm (62233)


Thanks again for your answer Shokoniraya, you are so kind... but this still don't work. 1)I converted my .dds to .tga with xnConvert. 2) I created a batch file with your code(md "output_folder" "texconv.qgp" -y -ft TGA -m 1 "my_image.png" -o "output_folder"). 3) I have placed texconv.exe and batch file in the .tga folder and I have double-clicked on bach file... whats happened was... texconv don't started to process and convert them just an empty output folder was created.
  • Author
  • Localization

Shokoniraya, posted Mon Feb 15, 2021 2:39 pm (62241)


this is a bat file code
replace texconv.qgp to texconv.exe
and replace my_image.png to your image file name (texconv can supports most of popular image formats)

Code:
md "output_folder"
"texconv.qgp" -y -ft TGA -m 1 "my_image.png" -o "output_folder"
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.