Saturday, July 2, 2016

adobe photoshop - Transparency to unpremultiplied RGB + Alpha


I have a transparent layer in Photoshop CS5 (so internally, it's most probably stored as unpremultiplied RGB component plus an alpha component per pixel).


Now I want to transform this to an opaque layer (just unpremultiplied RGB) + a alpha mask. the result should look the same as the original.


I can't just underlie the transparent layer with black, take the selection from it as a mask and merge the layers, because this would result in the alpha being premultiplied in the RGB values.


I hope you understand the problem and can give me a solution to it.


As an alternative explanation: I want the REVERSE process of this:




  1. create a new layer and paste in any image

  2. create a mask with a white-to-black gradient

  3. apply the layer mask




Explanation images:


State A: enter image description here


State B: enter image description here





IMPORTANT: the layer is just for this example fully constant red - but you could think of any arbitrary image instead of the constant red. so - to go from state A to State B, one simply has to apply the layer mask.


I want to know how to go from State B to State A.




adobe photoshop - How to resize an image without losing quality



I have an image of 90x122 pixels i want to resize it to make it 512x512 pixels but the image loses it quality Is there any way of doing this without losing the quality?.




How can I create woodcut illustration in Illustrator and/or Photoshop?


Are these illustrations done manually by hand or in Illustrator? Is there a easier way to reproduce these kind of illustrations?


enter image description here


enter image description here


enter image description here


enter image description here



More examples here.




Friday, July 1, 2016

Should I have one unified design between mobile and desktop?



With a website I'm building, I'm wondering if I should combine the experiences between platforms together. For example, I'm wondering if I should keep this for both mobile and desktop. Here are some examples


Example Example 2


I'm mainly wondering about the header. Is it bad to keep a more mobile like design (meaning slide menus, e.t.c.) on desktop, or should I utilize more of the space that mobile would not have?



Answer



First off all, I appreciate that you seem to design your responsive web with a mobile-first approach (that's how I perceive it anyway).


As Imperative has already stated, consistency is generally a good thing. However, the mobile-sized interface might still be come through as consistent with the desktop-sized ditto even though they don't share the exact same navigation pattern. For instance branding elements, graphical profile, copy, artwork and information architecture might keep it together just fine. Especially important is that the IA is, at least, very similar for the users to find their way around the site. When the content is grouped and structured the same way, a user that is familiar with one of the platforms but new to the second will know what to look for and have a hunch of how too, which helps a lot.


The off-canvas drawer menu is (obviously) a solution that partially solves a common mobile interface problem: the deficit of real estate. But that's a problem that rarely applies when it comes to desktop interfaces. Consistency is valuable, but should you be consistent between your own interfaces, or with the standards for the respective platforms they're being used in?


Off-canvas drawer for mobile:



  • Access to all top level navigation items in one place


  • Robust in a sense that new items can be added in infinity (can be a curse too:)

  • Menu button is in a convenient position (even though it's usually in the "hard" corner)


Off-canvas for desktop:



  • I guess Fitt's law still applies, and the expedition up the north-western corner of the screen can actually be quite long. A drop in efficiency?

  • You don't always want to fill the entire width with content as the user can use a very wide screen on a PC, which can make the positioning of the menu and its button really awkward, and actually even hard to see.

  • A button in the corner can interfere with hot corners, or rather, the other way around.

  • An extra click, that could have been avoided, is added to reach a menu item.

  • The menu items are obscured until the user has visited the menu, when they could have been displayed directly.



Based on the arguments above, I would recommend a different pattern than the drawer menu for the desktop site.


terminology - What is the exact difference between fluid and responsive design?


What is the exact difference between fluid and responsive design?



I am bit confused about fluid and responsive design. Fluid is the one where we give width in percentages so that design will look good on browsers even if shrink or expand the browser. But what's different about responsive?




volatility - Local vol, stochastic vol, implied vol


I've been studying volatility modelling over past the few days; in particular, the connections between local vol, stochastic vol, implied vol. I've been reading Gatheral's book "The volatility surface". I'm finding it pretty tough to follow. I've also read relevant chapters in Willmott's Quant Finance book. Overall, what are some other great resources to learn about this topic? I am not looking for the most advanced papers, but rather some introductory/intermediate material. My background is in applied maths and finance. I know this paper is fairly popular: https://arxiv.org/pdf/1204.0646.pdf. Looking for any help I can get on the topic, thanks.



Answer




Along with Gatheral's book, I'd recommend reading Lorenzo Bergomi's "Stochastic Volatility Modelling". The first 2 chapters are available for download on his website. That being said, let me try to give you the basic picture.


Below we assume that the equity forward curve $F(0,t)=\Bbb{E}_0^\Bbb{Q}[S_t]$ is given for all $t$ smaller than some relevant maturity $T$. The risk-neutral drift $\mu(t)$ is inferred from that forward curve considering a pure diffusion framework (i.e. no jumps). The same goes for the discounting curve and the risk-free rate $r(t)$. We also assume that there is no arbitrage in the market.


Implied volatility


As Rebonato puts it: implied volatility is the wrong number to put in the wrong formula to get the right price.


You should thus consider it as an alternative and equivalent way to describe vanilla option prices: instead of using the market price of an option, you find the volatility figure $\sigma$ to be plugged inside the Black-Scholes pricing formula - along with the appropriate forward price and discount factor - to recover the former price. There is only 1 such figure because the BS price is a one-to-one mapping from the volatility to price space, all other things equal.


If you do this for all listed expiries $T=\{T_1,\dots,T_N\}$ and all listed strikes $K=\{K_1,\dots,K_M\}$, you'll end up with the so-called (discrete) implied volatility surface $\Sigma(T,K)$ corresponding to the prices $V(T,K)$.


The paper you mention is one of the many which studies how you could move from this discrete $T \times K$ specification of the IV surface to a continuous one by relying on some specific parametrisation (here SVI), which aims at precluding arbitrage opportunities while interpolating/extrapolating the original data points.


Local volatility


Is the function $\sigma_{LV}(t,S)$ such that when the following 1D Markovian diffusion model for the equity spot price is used $$ \frac{dS_t}{S_t} = \mu(t) dt + \sigma(t,S_t) dW_t $$ the prices for any $(T,K)$ returned by the model perfectly coincide with the market prices $V(T,K)$, or equivalently as we've just seen, allow to fall-back on the exact same volatility surface $\Sigma(T,K)$.


Dupire's seminal work shows that from the previous definition the local volatility function should verify (see also derivation here) $$ \sigma_{LV}^2(t=T, S=K) = \frac{\Sigma^2 + 2\Sigma T \left( \frac{\partial \Sigma}{\partial T} + \mu(T)K \frac{\partial \Sigma}{\partial K} \right)} {\left( 1-\frac{Ky}{\Sigma} \frac{\partial \Sigma}{\partial K} \right)^2 + K \Sigma T \left( \frac{\partial \Sigma}{\partial K} - \frac{1}{4} K \Sigma T \left( \frac{\partial \Sigma}{\partial K} \right) ^2 + K \frac{\partial^2 \Sigma}{\partial K^2} \right)} \tag{1} $$ where $y = \text{ln}(K/F(0,T))$ and $\Sigma = \Sigma(T,K)$.



Reciprocally, in Chapter 2 of Bergomi's book but also in Gatheral's, it is shown how implied volatilities can be seen as a weighted expectation of local volatilities, see for instance equation (2.32) and (2.33) in Bergomi's book.


Stochastic volatility


Amounts to considering a diffusion model of the form \begin{align} \frac{dS_t}{S_t} = \mu(t) dt + \sigma_t dW_t^S \\ d\sigma_t = \alpha(t,\sigma_t) dt + \beta(t,\sigma_t) dW_t^\sigma \end{align} with some correlation between the 2 driving Brownian motions. The instantaneous volatility of log-returns $\sigma_t$ is this time stochastic, hence the name. There is no direct built-in connection to vanilla option prices. That being said, this modelling framework allows to generate volatility smiles and could therefore be calibrated to the market.


If you want to calibrate the model so that vanilla option prices are recovered you can appeal to the Gyöngy's theorem (also discussed in both Gatheral and Bergomi) and the dynamics of $\sigma_t$ should satisfy $$ \Bbb{E}_0^\Bbb{Q} \left[ \sigma_t^2 \vert S_t = S \right] = \sigma^2_{LV}(t,S) \tag{2}$$


Again pros and cons are examined in details in Bergomi's book. To go even further you could have a look at forward variance models and local-stochastic volatility models.


[TL;DR]



  • Implied volatility is a one-to-one mapping between a vanilla option price and a specific model quantity -- the Black-Scholes volatility.

  • Local volatility goes one step further by creating a one-to-one mapping with not one but all the vanilla option prices. This relies on a 1D Markovian representation of the spot dynamics where the instantaneous variance of the log-returns deterministically depends on the spot price level at all times (complete model).

  • Stochastic volatility amounts to considering a 2D diffusion framework where the instantaneous variance of the equity log-returns is a separate stochastic factor (incomplete model). There is no 'built-in' connection with the market although this model allows to generate IV smiles. When a stochastic volatility model is calibrated to the market, it is usually impossible to match all vanilla option prices due to the finite number of model parameters at hand.


  • Equations $(1)$ and $(2)$ establish links between the 3 relevant quantities.


What are some regular contests unpublished short story authors might enter?


One good way for new authors to become recognized is a contest. What contests exist that:



  • Accept short stories

  • Occur on a regular (annual, semi-annual, bi-annual, etc.) basis


  • Are friendly to unpublished authors

  • Ideally provide a good amount of publicity within the target market.


If the contest caters to a specific genre or has important entrance criteria, those would be helpful to note.



Answer



Writers of the Future is for SF/F, but it's the longest-running contest in the genre, and carries significant fame and prestige. No other contest comes close. WotF is specifically for unpublished writers, and occurs once a quarter. Check the website for entrance dates and other information.


technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...