White is not pure white in overlay of PNG on JPEG image

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

White is not pure white in overlay of PNG on JPEG image

Jason Green
I'm sorry to bother you all with this but I have been unable to resolve the
issue with my own research (which is really rare for me :) ).

I am trying to overlay pngs of text that have been generated by another
source onto jpg photos. I have simplified the command down to it's simplest
example and I am using public images so you can even try the command
yourself.

ffmpeg -y -i "
https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
-i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
-movflags faststart -filter_complex "[0][1]overlay=x=131:y=300" -q:v 6 -f
image2 -codec:v mjpeg test_remote.jpg

The white text png has perfectly white pixels in the original, but in the
final they are slightly grey. I have tried various options using format but
I can't manage to get it to work.

Any suggestions would be appreciated.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Paul B Mahol
On 10/9/19, Jason Green <[hidden email]> wrote:

> I'm sorry to bother you all with this but I have been unable to resolve the
> issue with my own research (which is really rare for me :) ).
>
> I am trying to overlay pngs of text that have been generated by another
> source onto jpg photos. I have simplified the command down to it's simplest
> example and I am using public images so you can even try the command
> yourself.
>
> ffmpeg -y -i "
> https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
> -i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
> -movflags faststart -filter_complex "[0][1]overlay=x=131:y=300" -q:v 6 -f
> image2 -codec:v mjpeg test_remote.jpg
>
> The white text png has perfectly white pixels in the original, but in the
> final they are slightly grey. I have tried various options using format but
> I can't manage to get it to work.
>
> Any suggestions would be appreciated.

Avoid implicit colorspace conversion, and do it explicitly.

> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Jason Green
Ok so I get that png doesn't have a colourspace, so do I need to specify a
colorspace for the input? Plus I need to specify the output I am guessing.
I have tried outputting with various colorspace and color_range values but
I'm having no luck. Do I need to just keep experimenting with these values?


On Wed, 9 Oct 2019 at 12:19, Paul B Mahol <[hidden email]> wrote:

> On 10/9/19, Jason Green <[hidden email]> wrote:
> > I'm sorry to bother you all with this but I have been unable to resolve
> the
> > issue with my own research (which is really rare for me :) ).
> >
> > I am trying to overlay pngs of text that have been generated by another
> > source onto jpg photos. I have simplified the command down to it's
> simplest
> > example and I am using public images so you can even try the command
> > yourself.
> >
> > ffmpeg -y -i "
> > https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg
> "
> > -i "
> https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
> > -movflags faststart -filter_complex "[0][1]overlay=x=131:y=300" -q:v 6 -f
> > image2 -codec:v mjpeg test_remote.jpg
> >
> > The white text png has perfectly white pixels in the original, but in the
> > final they are slightly grey. I have tried various options using format
> but
> > I can't manage to get it to work.
> >
> > Any suggestions would be appreciated.
>
> Avoid implicit colorspace conversion, and do it explicitly.
>
> > _______________________________________________
> > ffmpeg-user mailing list
> > [hidden email]
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
*Jason Green*






*Principal Developer Email: [hidden email]
<[hidden email]> Mobile: +44 7462 752 694
<++44+7462+752+694>*
[image: Snapchat] <https://www.snapchat.com/add/threads_styling> [image:
Instagram] <https://www.instagram.com/threadsstyling> [image: LinkedIn]
<https://api.whatsapp.com/send?phone=447881362517>

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking any
action in reliance on the contents of this information is strictly
prohibited.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Paul B Mahol
On 10/9/19, Jason Green <[hidden email]> wrote:
> Ok so I get that png doesn't have a colourspace, so do I need to specify a
> colorspace for the input? Plus I need to specify the output I am guessing.
> I have tried outputting with various colorspace and color_range values but
> I'm having no luck. Do I need to just keep experimenting with these values?
>

colorspace in this context: jpg is yuv ang png is rgb.

>
> On Wed, 9 Oct 2019 at 12:19, Paul B Mahol <[hidden email]> wrote:
>
>> On 10/9/19, Jason Green <[hidden email]> wrote:
>> > I'm sorry to bother you all with this but I have been unable to resolve
>> the
>> > issue with my own research (which is really rare for me :) ).
>> >
>> > I am trying to overlay pngs of text that have been generated by another
>> > source onto jpg photos. I have simplified the command down to it's
>> simplest
>> > example and I am using public images so you can even try the command
>> > yourself.
>> >
>> > ffmpeg -y -i "
>> > https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg
>> "
>> > -i "
>> https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
>> > -movflags faststart -filter_complex "[0][1]overlay=x=131:y=300" -q:v 6
>> > -f
>> > image2 -codec:v mjpeg test_remote.jpg
>> >
>> > The white text png has perfectly white pixels in the original, but in
>> > the
>> > final they are slightly grey. I have tried various options using format
>> but
>> > I can't manage to get it to work.
>> >
>> > Any suggestions would be appreciated.
>>
>> Avoid implicit colorspace conversion, and do it explicitly.
>>
>> > _______________________________________________
>> > ffmpeg-user mailing list
>> > [hidden email]
>> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> >
>> > To unsubscribe, visit link above, or email
>> > [hidden email] with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
>
> --
> *Jason Green*
>
>
>
>
>
>
> *Principal Developer Email: [hidden email]
> <[hidden email]> Mobile: +44 7462 752 694
> <++44+7462+752+694>*
> [image: Snapchat] <https://www.snapchat.com/add/threads_styling> [image:
> Instagram] <https://www.instagram.com/threadsstyling> [image: LinkedIn]
> <https://api.whatsapp.com/send?phone=447881362517>
>
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the system manager.
> This message contains confidential information and is intended only for the
> individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete this e-mail from your system. If you are not the intended recipient
> you are notified that disclosing, copying, distributing or taking any
> action in reliance on the contents of this information is strictly
> prohibited.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Jason Green
I feel like I'm so close with your help, but the docs around some of these
commands is not great and I just can't figure it out.
Could you please post an example of how you use these options in this
context. I made the image public so you can literally amend the command I
posted originally and try it yourself. No matter what I do the png text is
always a bit grey. Here it is again in its simples form.

ffmpeg -i "
https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
-i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
-filter_complex "[0][1]overlay=x=131:y=300" -codec:v mjpeg test_remote.jpg
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Paul B Mahol
On 10/9/19, Jason Green <[hidden email]> wrote:

> I feel like I'm so close with your help, but the docs around some of these
> commands is not great and I just can't figure it out.
> Could you please post an example of how you use these options in this
> context. I made the image public so you can literally amend the command I
> posted originally and try it yourself. No matter what I do the png text is
> always a bit grey. Here it is again in its simples form.
>
> ffmpeg -i "
> https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
> -i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
> -filter_complex "[0][1]overlay=x=131:y=300" -codec:v mjpeg test_remote.jpg

If you have read overlay documentation you would use format=gbrp option.

> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Jason Green
In reply to this post by Jason Green
Actually I managed to get it working by specifying format=gbrp in the
overlay filter.

ffmpeg -i "
https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
-i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
-filter_complex "[0][1]overlay=x=131:y=300:format=gbrp" -codec:v mjpeg
test_remote.jpg

Thanks for the help

On Wed, 9 Oct 2019 at 17:15, Jason Green <[hidden email]>
wrote:

> I feel like I'm so close with your help, but the docs around some of these
> commands is not great and I just can't figure it out.
> Could you please post an example of how you use these options in this
> context. I made the image public so you can literally amend the command I
> posted originally and try it yourself. No matter what I do the png text is
> always a bit grey. Here it is again in its simples form.
>
> ffmpeg -i "
> https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text-bg.jpg"
> -i "https://asset-info-examples.s3-eu-west-1.amazonaws.com/white-text.png"
> -filter_complex "[0][1]overlay=x=131:y=300" -codec:v mjpeg test_remote.jpg
>
>
>

--
*Jason Green*






*Principal Developer Email: [hidden email]
<[hidden email]> Mobile: +44 7462 752 694
<++44+7462+752+694>*
[image: Snapchat] <https://www.snapchat.com/add/threads_styling> [image:
Instagram] <https://www.instagram.com/threadsstyling> [image: LinkedIn]
<https://api.whatsapp.com/send?phone=447881362517>

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. If you are not the intended recipient
you are notified that disclosing, copying, distributing or taking any
action in reliance on the contents of this information is strictly
prohibited.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: White is not pure white in overlay of PNG on JPEG image

Jason Green
In reply to this post by Paul B Mahol
Yes sorry, I was looking too much into colorspace and didn't realise that
it was during the overlay that the colour change was happening. Thanks.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".