TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

 找回密码
 新人加入
楼主: Alex
打印 上一主题 下一主题

[已解决] PixTexture color! [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2013-11-3 15:09:09 |显示全部楼层 |倒序浏览
When I'm using PixTexture the colors of the syllable some of them not same, some of them have more alpha


Untitled32.png

before in NyuFx have same problem but Youka have fixed

Rank: 4

沙发
发表于 2013-11-3 21:20:39 |显示全部楼层
本帖最后由 Alex 于 2013-11-3 21:21 编辑

OK

I don't know actually which function have to write first..

this is the code
  1.     PIX_t = TextPix(Font, _txt)            
  2.    
  3.     dx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
  4.     dy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1]
  5.     dur = _KT * 10

  6.     PIX_t = PixTexture(PIX_t, PIX_tex)     
  7.     PIX_out = TextPix(FontOut, _txt)      
  8.     PIX_out = PixTexture(PIX_out, PIX_tex2)
  9.     PIX_out = PixColorMul(PIX_out, 1, 1, 1, 0)   
  10.     PIX_out = PixBlur(PIX_out, 0)           
  11.     PIX_ori = CombinePixs(PIX_out, PIX_t)   
  12.     points = PixPoints(PIX_ori)
  13.     pt_num = len(points)
复制代码
and as you said i have to use PixEnlarge(PIX,x,y) function and  PixCrop(pix, left, top, right, bottom)

pix = it will be the path on pic right?
x & y is a normal position (_x,_y) or pixs position
pixx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
pixy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1])

?

and regarding PixCrop function , pix I think is a path of pic right?!
and what should Instead of (left, top, right, bottom) write?

Rank: 4

板凳
发表于 2013-11-3 22:51:46 |显示全部楼层
本帖最后由 Alex 于 2013-11-3 22:57 编辑

Thank you very much
it's ok now



Rank: 4

地板
发表于 2013-11-4 22:41:22 |显示全部楼层
本帖最后由 Alex 于 2013-11-4 22:41 编辑

I have another 2 question

Why the position it's not exactly correct, there is space between letters?

---

and my second question, if the line(text) position in Aegisub is alignment 7 or 9
when i'm using this postion >>
  1.         dx = _x - int(_a / 2 + 0.5)        
  2.         dy = _y - int(_Fs / 2 + 0.5)      
复制代码
the line (text) it will be in the center of video (an8), what is the right position for alignment7 and 9?

Rank: 4

5#
发表于 2013-11-5 12:25:47 |显示全部楼层

Rank: 4

6#
发表于 2013-11-5 23:11:06 |显示全部楼层
本帖最后由 Alex 于 2013-11-5 23:52 编辑

When i used pixel, I got some space between letters, I think it's happening for pixels
you can see the pic, and you will see there is a space between letters

anyway it's ok

Thank you for your patience with me, it's just a testing XD

Rank: 4

7#
发表于 2013-11-8 00:34:46 |显示全部楼层
I knew what is the problem before ur answer , thank you =D

Rank: 4

8#
发表于 2013-11-12 18:28:27 |显示全部楼层
milky!

How can I use width & height to get metrics of text?

Rank: 4

9#
发表于 2013-11-13 18:03:19 |显示全部楼层
本帖最后由 Alex 于 2013-11-13 18:31 编辑

Ok

I'm trying to make a square clip by using text metrics ( Height & width Only)
but I got a problem -_-



Why I can't use %d ?


Im using a normal "\k"
  1. from tcaxPy import *


  2. def tcaxPy_Init():
  3.     global _FD                              
  4.     global _Blur
  5.     global _text
  6.     global _textLength
  7.     global _width
  8.     global _height
  9.     global _advance
  10.     global _fx_width
  11.     global _fx_height

  12.     _fx_width = GetVal (val_ResolutionX)
  13.     _fx_height = GetVal (val_ResolutionY)
  14.     _text = GetVal (val_Text)
  15.     _textLength = GetVal (val_TextLength)
  16.     _width = GetVal(val_TextWidth)
  17.     _height = GetVal (val_TextHeight)
  18.     _advance = GetVal (val_TextAdvance)
  19.     _FD = 1000 / GetVal(val_FXFPS)
  20.     _Blur = GetVal(val_Blur)


  21. def tcaxPy_Fin():
  22.     pass



  23. def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
  24.     ASS_BUF  = []         
  25.     TCAS_BUF = []      

  26.     x = _x
  27.     y = _y

  28.     text = "{\\pos(%d,%d)\\clip(m %d %d l %d %d l %d %d)} " % (x,y, _width[_i],y-10,x+10,y-10,x+10,y+10)
  29.     text1 = "{\\pos(%d,%d)}%s" % (x,y,_txt)
  30.     ass_main(ASS_BUF, SubL(_start , _end , 2), '', text)
  31.     ass_main(ASS_BUF, SubL(_start , _end , 2), '', text1)                           

  32.     return (ASS_BUF, TCAS_BUF)
复制代码

Rank: 4

10#
发表于 2013-11-14 15:16:28 |显示全部楼层


Nothing happened ,  saying that %i same %d +_+
I tested everything, doesn't solve my problem!

Rank: 4

11#
发表于 2013-11-14 20:07:14 |显示全部楼层
as I remember I have did that _width[_i] [_j]
anyway I will see again

Rank: 4

12#
发表于 2013-11-17 20:13:12 |显示全部楼层
本帖最后由 Alex 于 2013-11-17 20:16 编辑

it's ok now,

but shape position why it's different should be same text clip   -_-

8.png
  1.         th =   _TH[_i][_j]/1.4
  2.         tw =  _TW[_i][_j]/2
  3.         XP_fix = 20


  4.         text3 = "{\\an8\\pos(%d,%d)\\bord0\\p1}m %d %d l %d %d l %d %d l %d %d"%(x+XP_fix,y , tw,th, -tw, th, -tw, -th, tw, -th)
  5.         ass_main(ASS_BUF, SubL(_start,te,1) ,'',text3)
复制代码

Rank: 4

13#
发表于 2013-11-19 14:45:57 |显示全部楼层
本帖最后由 Alex 于 2013-11-19 15:30 编辑

Hahaha... I see that, I miss you XD
Anyway.  I didn't use pixels its shape only and the position is _x & _y
if u want all files I will upload

Rank: 4

14#
发表于 2013-11-19 15:38:15 |显示全部楼层
本帖最后由 Alex 于 2013-11-19 17:20 编辑
  1.         th =   _TH[_i][_j]/1.4
  2.         tw =  _TW[_i][_j]/2
  3.         XP_fix = 20

  4.         ts = _start  
  5.         te = _end  
  6.         text1 = "{\\pos(%d,%d)\\bord0\\1c&H000000&\\clip(m %d %d l %d %d l %d %d l %d %d)}%s"%(x,y ,x-tw,y-th, x+tw, y-th, x+tw, y+th, x-tw, y+th, _txt)
  7.         ass_main(ASS_BUF, SubL(ts,te, 5),'', text1)
  8.         text2 = "{\\an8\\pos(%d,%d)\\bord0\\p1}m %d %d l %d %d l %d %d l %d %d"%(x+XP_fix,y , tw,th, -tw, th, -tw, -th, tw, -th)
  9.         ass_main(ASS_BUF, SubL(ts,te,1) ,'',text2)
复制代码
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-5-3 18:50

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH