Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving masked UIImage to disk produces wrong image
    primarykey
    data
    text
    <p>I've an app with a lot of masked image. For performance sake I ned to generate those masked image on disk and then incorporate them in the app (they'll be uploaded on demand nut not masked on the fly because it is already done).</p> <p>I'm using this kind of coding </p> <pre><code>NSString *pngPath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/Test_%d.png",i]]; NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/Test_%d.jpg",i]]; // Write a UIImage to JPEG with minimum compression (best quality) // The value 'image' must be a UIImage object // The value '1.0' represents image compression quality as value from 0.0 to 1.0 [UIImageJPEGRepresentation([self maskImageWithStroke:image withMask:maskImage], 1.0) writeToFile:jpgPath atomically:YES]; // Write image to PNG [UIImagePNGRepresentation([self maskImageWithStroke:image withMask:maskImage]) writeToFile:pngPath atomically:YES]; </code></pre> <p>and it works perfectly for my intermediate images but not with the final one.</p> <p>Here is the process of multiple mask and blan I use :</p> <ol> <li><p>take an image and mask it to obtain the maskedImage</p></li> <li><p>List item take the mask and resize it a bit bigger : biggerMask</p></li> <li><p>blend maskedImage and biggermask to have the maskedStrokedImage stroked by biggrMask (this is the only way I found to add an irregular stroke on the irregular masked image)</p></li> <li><p>mask maskedStrokedImage with biggerMask to obtain my final result.</p></li> </ol> <p>The problem is : saving the image obtained on step 1 is ok : I've got a JPG and PNG with exactly what I need.</p> <p>My goal is to save the result of step 4 to disk but the result is an imahe showing some part of the stroke and the rest is white ...</p> <p>Any Idea why I'm unable to save the step 4 to disk ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload